Detecting CSS property value of a html element by JavaScript -
Detecting CSS property value of a html element by JavaScript -
untill alert ok, if not executing. here programme stack. there way observe display property of div "bloc" or "none"?
for(i=1;i<=10;i++) { alert("hamdun soft past job deleted"); if(document.getelementbyid(i).style.display=="block") document.getelementbyid(i).innerhtml="hamdun soft clear now"; }
oh! kepp in mind div id=1 10, one's display= "block" , of 9 "none". did javascript program. need observe "block" one. tanks.
the issue element.style.display
work when element has inline style. need computed style:
class="snippet-code-js lang-js prettyprint-override">for(i=1;i<=10;i++){ var elem = document.getelementbyid(i); if((elem.currentstyle ? elem.currentstyle.display : getcomputedstyle(elem, null).display) == 'block') elem.innerhtml="hamdun soft clear now"; }
class="snippet-code-html lang-html prettyprint-override"><div id="1">aaa</div> <div id="2">aaa</div> <div id="3">aaa</div> <div id="4">aaa</div> <div id="5">aaa</div> <div id="6">aaa</div> <div id="7">aaa</div> <div id="8">aaa</div> <div id="9">aaa</div> <div id="10">aaa</div>
note: elem.currentstyle
first checked because ie can utilize .
javascript html css properties
Comments
Post a Comment