This project is archived and is in readonly mode.

#1213 ✓invalid
Stephan

new Element('a') returns href instead of the object HTMLElement

Reported by Stephan | April 8th, 2011 @ 10:58 AM

alert( new Element('div') );
returns correctly: [object HTMLDivElement]

alert( new Element('a') );
returns falsely: ''

alert( new Element('a', {'href': 'http://www.url.de'}) );
returns falsely: 'http://www.url.de'

Comments and changes to this ticket

  • Stephan

    Stephan April 8th, 2011 @ 11:01 AM

    Sorry, I forgot:
    Browser: Safari Version 5.0.4 (6533.20.27) on Mac OS X 10.6.6

  • Jan Kassens

    Jan Kassens April 8th, 2011 @ 11:43 AM

    • State changed from “new” to “invalid”

    This is not a bug in MooTools, a elements apparently return the href when toString is invoked on them.

    document.createElement('a').toString()
    

    gives "" for me in Chrome and Firefox (I didn't test any other browser).

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages