Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to add attribute to selected element in javascript

	// Selecting the element
    var btn = document.getElementById("myBtn");
	
    // Setting new attributes
    btn.setAttribute("class", "click-btn");
    btn.setAttribute("disabled", "");
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript set and get cookie 
Javascript :: javascript get cookie 
Javascript :: divide array of objects to 4 arrays js 
Javascript :: javascript string except last character 
Javascript :: regex password 
Javascript :: query params in next js 
Javascript :: regex validate double with 2 decimals 
Javascript :: Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3" 
Javascript :: how to clear innerhtml in javascript 
Javascript :: how to get visitor ip address in javascript 
Javascript :: scroll to bottom of a div 
Javascript :: regex for no whitespace at the beginning and end 
Javascript :: how to create external link javascript 
Javascript :: foreach jquery 
Javascript :: jquery on change function not working 
Javascript :: loopback model properties 
Javascript :: discord.js role regex 
Javascript :: how to can i get custom data attribute value in javascript 
Javascript :: how to execute javascript cde on window rotate 
Javascript :: add firebase angular 
Javascript :: payload too large nodejs 
Javascript :: node redis json push to array 
Javascript :: how to change the query parameter of the url in javascript 
Javascript :: bootstrap dropdown not working in angular 8 
Javascript :: javascript scroll down 
Javascript :: invalid chai property 
Javascript :: js vanilla when i remove one object it removes all of them 
Javascript :: javascript check if is array 
Javascript :: js make element invisible 
Javascript :: standalone form inside reactive form 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =