简体   繁体   中英

simple javascript code doesn't work, can't figure out why

I don't use javascript alot but this should be so simple I shouldn't fail on it but after trying to get it working for 30 minutes I need to ask for help:

I have this button

<button onclick="showMembers()">test</button> 

and this code in the < head>

    <script type="text/javascript">
function showMembers()
{
    document.getElementByID( 'MembersBox' ).style.display='block';

}
</script>

this is the html id:

<article id="MembersBox" style="display: none;" class="module width_quarter">

and I can't get it to show, nothing happens, inspecting it with firebug says nothing anywhere about javascript errors.

change getElementByID to getElementById

jsfiddle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM