Gol. D Roger Gol. D Roger - 4 years ago 128
Javascript Question

Convert Jquery code into pure javascript code

I have a following Jquery code and I need to convert it into pure javascript code. Can any one please help me to convert it to javascript code

$( "#buttonOne" ).on('click', function() {
$('#divOne').hide();
});


Thanks in advance

Answer Source

It should be easy! Here you go:

document.getElementById("buttonOne").addEventListener("click", function() {
    document.getElementById("divOne").style.display = "none";
});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download