put new attribute on html tag using javascript
// Selecting the element
var btn = document.getElementById("myBtn");
// Setting new attributes
btn.setAttribute("class", "click-btn");
btn.setAttribute("disabled", "");// Here's what you do for the style attribute
span.setAttribute("style", "width:110%;float:center;left-margin:-10px;top-margin:-10;");document.getElementsByTagName("H1")[0].setAttribute("class", "democlass");
Also in JavaScript:
- js create object from array
- alphabetical order array javascript
- how to numbers by checked in checkbox in javascript
- javaascript for unliking twitter
- potencia em javascript
- user property in express jwt
- async useeffect
- dropdown validation using jquery
- how to change package name in react native
- notify js
- purecomponent re rendering
- javascript class static method
- change abclground onload jquery
- comment in js
- reverse geocoding javascript map
- angular download blob pdf
- send a message to a specific channel discord.js
- remove extra space in string javascript
- convert datetime to timestamp javascript
- js object keys
- js hangman with repeated characters
- convert date dd/mm/yyyy to date object js
- right click of mouse and block F12 key
- react conditional class