Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js getattribute

const link = document.querySelector('a');

console.log(link.getAttribute('href'));
Comment

getAttribute

<!-- example div in an HTML DOC -->
<div id="div1">Hi Champ!</div>

// in a console
const div1 = document.getElementById('div1');
//=> <div id="div1">Hi Champ!</div>

const exampleAttr= div1.getAttribute('id');
//=> "div1"

const align = div1.getAttribute('align')
//=> null
Comment

getattribute javascript

let attribute = element.getAttribute(attributeName);
Comment

getattribute javascript

<!-- example div in an html DOC -->
<div id="div1">Hi Champ!</div>

// in a console
const div1 = document.getElementById('div1');
//=> <div id="div1">Hi Champ!</div>

const exampleAttr= div1.getAttribute('id');
//=> "div1"

const align = div1.getAttribute('align')
//=> null

Comment

getattribute

getAttribute(attributeName)
Comment

PREVIOUS NEXT
Code Example
Javascript :: 2d array in js 
Javascript :: how to check if input is string javascript 
Javascript :: loop node list 
Javascript :: creating react app 
Javascript :: try catch async await 
Javascript :: convert json object to lowercase 
Javascript :: at leastone checkbox required jquery 
Javascript :: how to update node in terminal 
Javascript :: process exit code 
Javascript :: map function react 
Javascript :: react native firebase community template 
Javascript :: background image not loading from a link react 
Javascript :: javascript es6 class 
Javascript :: javascript string concat vs + 
Javascript :: two digits number javascript 
Javascript :: axios post request javascript 
Javascript :: how to push key value pair to object javascript 
Javascript :: textarea onclick select all 
Javascript :: javascript slice 
Javascript :: comparing two array of objects in javascript returning differences 
Javascript :: expres body parser 
Javascript :: load external javascript from console 
Javascript :: convert array object to string javascript 
Javascript :: how to change port in react js 
Javascript :: replace character inside a string in JavaScript 
Javascript :: js loop 
Javascript :: ngmodel component angular 
Javascript :: async await in javascript 
Javascript :: abrir dialog angular materia 
Javascript :: js fetch catch 401 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =