What is the JavaScript equivalent of jQuery's hide() and show()? [duplicate] What is the JavaScript equivalent of jQuery's hide() and show()? [duplicate] jquery jquery

What is the JavaScript equivalent of jQuery's hide() and show()? [duplicate]


this is simple

document.getElementById('myElement').style.display = 'block'; // showdocument.getElementById('myElement').style.display = 'none'; // hide

add a onSelect="selectOptionsupdated(this) in your select

then

function selectOptionsupdated(select){//do your stuff here  }


var myButton = document.getElementById('myButton');//hidemyButton.style.display = 'none';//showmyButton.style.display = 'block';

Updatefor your select tag..try this

html

<select id="list"><option id="1">Science</option></select>

js

var list = document.getElementById('select');list.addEventListener('change', listSelect, false);function listSelect(){        var selected = list.options[list.selectedIndex].value;//Selected option value    //hide    myButton.style.display = 'none';    //show    myButton.style.display = 'block'; }


document.getElementById("button").style.visibility="visible|hidden|collapse|inherit";