Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-01-2009
Xan Xan is offline
Member
 
Join Date: Jan 2009
Posts: 576
SetAttribute not working

i was working with some coding but i found my self in trouble when i got that setAttribute is not working. i used in internet explorer 6,7 but not working please anyone can help me to find out what is wrong ?
Reply With Quote
  #2  
Old 27-01-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: SetAttribute not working

This is probably because IE considers setAttribute as setting the property of the actual javascript object. By setting the style attribute on a node, IE interprets it as setting node.style, which is not the actual attribute (node.style being an array of the different css settings instead). That's also why you can't set the 'class' or 'for' attributes, because on a element object, the old method of setting class and the for attribute are node.className and node.htmlFor.


When calling the DOM method .setAttribute( attName, attValue ); in IE, there are several circumstances where it will not work.
Setting the "name" attribute does not work, the "colspan" & "rowspan" attributes for th and td tags does not work, the "frameborder" attribute on iframes does not work.
Reply With Quote
  #3  
Old 27-01-2009
Member
 
Join Date: Dec 2008
Posts: 207
Re: SetAttribute not working

Using the DOM Methods to build up new content for your page, be aware that in IE, you can't pre-check a radio button or a checkbox using .setAttribute('checked', 'checked'); or even myCheckBoxObject.checked = true; *unless* you add the element to the page first.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "SetAttribute not working"
Thread Thread Starter Forum Replies Last Post
Fingerprint Reader is working but DigitalPersona is not working in HP Pavilion tx2000 KameswaraRao Portable Devices 10 02-05-2012 10:55 PM
Voice not working in X3 Terran Conflict, but working in X3: Albion Prelude Dvimida Video Games 8 20-12-2011 11:39 AM
Touch screen not working on HP Touchsmart 500 but windows still working Ebadaah28 Portable Devices 5 12-08-2011 09:53 AM
windows vista restore not working/blue screen help/safe mode not working rrr666 Vista Help 4 26-07-2009 12:37 AM
WSUS MMC is working, Synchronization is working, but WSUS fails to download updates and Self Update is not working Andrus K Server Update Service 1 03-07-2008 09:32 PM


All times are GMT +5.5. The time now is 06:13 PM.