html - Javascript not changing element attribute -


i trying change attribute "hidden" of element true javascript after timeout of 1,000 millisecond not changing attribute. yes timeout working fine i've tested that, functions correct! last part in using setattribute() function not working.

html:

<div id="gamepanel" hidden="true">     <div id="bb">         <div id="map">          </div>     </div>     <p id="status"> welcome back! </p>     <input type="button" id="changebio" value="change map" />     <input type="button" id="savegame" value="save game" />     <div id="statusbar"> status </div> </div> 

javascript:

var panel = document.queryselector("#gamepanel"); panel.setattribute("hidden","false"); 

use

panel.removeattribute("hidden"); 

since hidden attribute boolean attribute, (the spec defines way),

the presence of boolean attribute on element represents true value, , absence of attribute represents false value.

then, doesn't have true , false values. can present (that is, hidden or hidden="hidden"), or not.

or, better, can change hidden property:

panel.hidden = false; 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -