Parameter: It takes only one parameter attributename
Suppose you have an anchor tag with following attributes
<a href="http://www.advancesharp.com" id="hlnkWebsite" target ="_blank" title= "Advance Sharp"> Advance Sharp</a>
<Script> //First get the object of which you want to get the attribute(s) var obj = document.getElementById(“hlnkWebsite”); // To get the id var id = obj. getAttribute("id"); //it will give hlnkWebsite // To get the target var id = obj. getAttribute("target"); //it will give _ blank // To get the title var id = obj. getAttribute("title"); //it will give Advance Sharp </Script>
Started career with .Net, and not working on client side technologies like angular, React etc. since last 12 years. But C# is really amazing language and I like to learn everything about C# and want to share whatever I know.
|By Alicia Gonzalez On 02 Dec, 12 Viewed: 687|
A website isn't complete without the inclusion of all the right elements. Progress bar is one of the key components of every website. It informs the user about the total waiting time for a particular web page or a specific task to load. Apart from adding value to the website, the progress bar is... By Celin Smith On 18 Feb 2015 Viewed: 4,930