javascript - InnerHTML getting Div Name -
i trying name of div
<div id="test" name="info1" onclick="func(this.name)">this div 1</div>
but when try print out name of div using innerhtml comes undefined. can done or doing wrong?
according w3schools div
cannot have name
attribute, can have id
, class
or title
. think dom isn't recognising attribute, therefore not making available javascript.
i made example here shows title
working , name
failing describe.
Comments
Post a Comment