How to set value in a hidden field and hide a div using Javascript? -


I'm a newbie for javascript and I want to know how to set values ​​in hidden fields using javascript How to set a value in a hidden field using Java script

P>

Set the value for hidden fields:

  var el = document.getElementById ('hidden area id'); El.value = 'some value';  

How to hide a single device by using javascript

Hide a div:

  var el2 = document.getElementById ('div id'); El2.style.display = 'none';  

If you click some element, then you want to make any of those tasks generational, you can:

  var btn = Document.getElementById ('button id'); Btn.onclick = function () {var el = document.getElementById ('hidden area id'); El.value = 'some value'; }  

Where the ID can be set to an element:

   

Take a look at this:


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -