Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FireFox removeAttribute doesnt work

    hello all,
    i have DOM code to remove an attribute and it works in IE but not firefox, i was wondering what i am doing wrong (i guess removeAttribute isnt supported in FF)?

    the code looks like this and is also attached if u want to give it a try:

    .....
    function processClick()
    {

    var SubmittedBy = document.getElementById('SubmittedBy');
    //SubmittedBy.disabled = false;
    //SubmittedBy.setAttribute('disabled', 'blah'); // not works
    //SubmittedBy.removeAttribute('disabled');
    SubmittedBy.removeAttribute('size');
    SubmittedBy.removeAttribute('disabled');


    }
    </script>
    <body>

    <div onClick="processClick()">Click HEREEEEEEEEEEEEE</div>

    <select name="SubmittedBy" disabled="disabled" size="3">
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    <option>TESTTTTTTTTTTTT</option>
    </select>
    Attached Files Attached Files

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    It is not the removeAttribute() method, it is the improper way you have referenced the object. When using getElementById(id), make sure your object has an id. Your object has only a name, which is not the same thing. IE takes the name as an id, if no id found, but this is an incorrect and silly approach. Give your object an id.
    Last edited by Kor; 05-16-2006 at 08:33 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts


    THANX


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •