473,378 Members | 1,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

remove attributes

I am using IE and I want to remove some attributes on my page before I
delete the rows as a result of what looks like memory leaks in my page.

I understand I can't remove the attributes, but the event handler is
removed.

here is my code:

var row_delete = document.getElementById("Task_Row_"+taskNum);
var obj = row_delete.getElementsByTagName("input");
for ( var i=0; i<obj.length; ++i )
{
var atts = obj[i].attributes;
for (var j=0;j<atts.length;j++)
{
if (atts[j].specified)
{atts[j] = null;}
}
}

I seem to get an error on this statement: atts[j] = null;

Mike

Oct 14 '05 #1
2 4530

mike wrote:
I am using IE and I want to remove some attributes on my page before I
delete the rows as a result of what looks like memory leaks in my page.

I understand I can't remove the attributes, but the event handler is
removed.

here is my code:

var row_delete = document.getElementById("Task_Row_"+taskNum);
var obj = row_delete.getElementsByTagName("input");
for ( var i=0; i<obj.length; ++i )
{
var atts = obj[i].attributes;
for (var j=0;j<atts.length;j++)
{
if (atts[j].specified)
{atts[j] = null;}
}
}

I seem to get an error on this statement: atts[j] = null;

Mike


You have an array of Attr objects. Try using the following:

if(atts[j].specified)
{
atts[j].value = "";
}

But if you're looking for a specific attribute, you should look into
using the getAttribute() method.

Oct 14 '05 #2
atts[j].value = "";

yes that works .... But It still looks like I get memory leaks.
But if you're looking for a specific attribute, you should look into
using the getAttribute() method.


http://www.quirksmode.org/dom/w3c_core.html#attributes shows this as
being incomplete for that method

Oct 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mikael Petterson | last post by:
Hi, I got some help to go from: bbBusState to BB_BUS_STATE. However I found out :-( that the xml contained attributes like: TxDeviceGroup and that becomes:
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
3
by: sam.stamport | last post by:
Hello, In my C# program I execute an attributes remove to remove all attributes in the following root node. <xtvd xmlns:xsd="http://www.w3.org/2001/XMLSchema"...
8
by: Gerry Viator | last post by:
Hi all, The following is part of XML file, how do I search through the file and remove an Element and all it's attributes. Example: TEST2? Of course I will pass the Element Name to remove from a...
8
by: Mikey | last post by:
I have an XML document as follows: <Menu> <Group> <Item Text="About Us" AccessRoles="All"> <Group> <Item Text="Option 1" AccessRoles="All" /> <Item Text="Option 2" AccessRoles="All" /> <Item...
2
by: fizzy | last post by:
i am fetching an xml document with the following structure: <?xml version="1.0" encoding="UTF-8"?> <DTCResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
0
by: Jonas | last post by:
Hi! I'm working with an ASP.NET web site that needs to conform with XHTML 1.0 Transitional and got an ASP.NET HtmlInputButton which automatically adds the attribute language="javascript" which...
0
by: deepak | last post by:
i have set multiple selection property in bith listboxes(html control) to true. i have taken 2 buttons(html control) say Button1,Button2.now i want to add mutiple selected items to another listbox...
0
by: Ismail | last post by:
Guys, I have the following code in page_load event of user control Go.Attributes.Add("onclick","if(" + search.ClientID + ".value==''){alert('" + noSearchText + "');return false;}"); ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.