Answers for "get all html element data using angular"

0

get all html element data using angular

File your-component-name.component.html

<input type="text" #inputbox>
<button type="submit" (click)="getelementData()">Show element data</button>

file your-component-name.component.ts
In the class make function named as 

getelementData(nameinput){
 console.log(nameinput);  // output will be the whole button element with their attributes
 // if you want to show specific attribute data then 
 console.log(nameinput.value);  // it will reflects the value of textbox which has been entered
}
Posted by: Guest on April-18-2020

Code answers related to "get all html element data using angular"

Browse Popular Code Answers by Language