html add id to element code example
Example 1: add id to element javascript
myPara.setAttribute("id", "id_you_like");
Example 2: javascript add id to element
myelement.id = yourid;
Example 3: referance html id css
<style>
#test {
/*Styleing here*/
}
</style>
<h1 id="test"></h1>
Example 4: html id
<style>
#grepperHeader {
background-color: lightblue;
color: navy;
padding: 40px;
text-align: center;
}
</style>
<h1 id="grepperHeader">grepperHeader</h1>