How to hide and show in html element dynamically

The html input element hides and shows with a link tag. example: yahoo mail Bcc hide and show

+3
source share
2 answers

This is done in Javascript.

For plain Javascript, i.e. without using jQuery, you can do this:

document.getElementById("idOfElement").style.display = "none"; // to hide    
document.getElementById("idOfElement").style.display = "block"; // to show

Here is a link with possible values ​​for this displayCSS element .

+3
source

yahoo does this with javascript.

using plaing JS for onlicklinks:

document.getElementById('someDiv').style.display = 'block'; //or 'none' to hide

using a JS library like jQuery:

$('#someDiv').show(); //or .hide();
+1
source

Source: https://habr.com/ru/post/1768380/


All Articles