// Hide div :
document.getElementById(div_id).style.display = none;
/// Show div :
document.getElementById(div_id).style.display = block;
const element = document.getElementById('id');
//or
const element = document.querySelector('#id');
// Save a reference to the element with id 'demo':
const demoElement = document.getElementById('demo');
function myFunc(variable){
var s= document.getElementById(variable);
s.value = 'New value'
}
function changeColor(newColor) {
var elem = document.getElementById('para');
elem.style.color = newColor;
}
function changeColor(newColor) {
var elem = document.getElementById('para');
elem.style.background-color = newColor;
}
document.getElementById("test")
<h1 id="demo">
<style>function demoFunction()
{document.getElementById("demo"). //Add what you want to change right here.}
</style>
let variableName = document.getElementById('#Id_name_you_gave_the_element');
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
//JavaScript can create dynamic HTML content:
<script>
document.getElementById("demo").innerHTML = "Date : " + Date(); </script>
</body>
</html>
var degiskenAdi = document.getElementById("paragraf1");
// getElementById returns elements that have the id specified. Example:
document.getElementById("specificparagraph").style.color = "blue";
/* The element with the id "specificparagraph" will have its text changed to
blue. */
<p id="YourId">How to use document.GetElementById in HTML</p>
<script>
document.GetElementById('YourId')./* The thing you need to do to your code... Here I want .innerHTML you can take any... */.innerHTML('/* what will it change... */')
</script>