Link to home
Start Free TrialLog in
Avatar of shuittny
shuittny

asked on

chrome and edge version of getElementById("p").attributes("title").value

does anyone know the Chrome and Edge version of this line:

getElementById("p").attributes("title").value?

I get a "no function exists" type of error for this on Google Chrome and Windows Edge but it works fine on other IE browsers
Avatar of Prakash Samariya
Prakash Samariya
Flag of India image

.attributes is a collection of given element and not the function!

So you have to use like collection/array like below
document.getElementById("p").attributes["title"].value

Open in new window

In other browser treat () as collection as well, so in that it works! But it good to use [] for array/collection for better resolution in all browser
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial