Cenzic 232 Patent
Paid Advertising
sla.ckers.org is
ha.ckers sla.cking
Sla.ckers.org
Q and A for any cross site scripting information. Feel free to ask away. 
Go to Topic: PreviousNext
Go to: Forum ListMessage ListNew TopicSearchLog In
Setting attributes dynamically in IE6,7 and 8
Posted by: dragunov
Date: January 15, 2010 07:04AM

Hi guys

Just wanted to know if there is a way to add an attribute in an element dynamically in IE..
Like if I want to add an attribute in an element dynamically in firefox I can do this:--

var a=document.getElementsByTagName("form");
a[0].setAttribute("onsubmit","alert(1)");

Now when I will submit the first form in the page I will get an alert(1) box..

Is there a way to do this in the IE's..

Thanks and Cheers!!
dragunov

Options: ReplyQuote
Re: Setting attributes dynamically in IE6,7 and 8
Posted by: PaPPy
Date: January 15, 2010 08:01AM

hide the button and redraw it with yours?

http://www.xssed.com/archive/author=PaPPy/

Options: ReplyQuote
Re: Setting attributes dynamically in IE6,7 and 8
Posted by: dragunov
Date: January 15, 2010 08:08AM

I don't have the option to hide the button.
Any other way ?
Cheers !!!

Options: ReplyQuote
Re: Setting attributes dynamically in IE6,7 and 8
Posted by: barbarianbob
Date: January 15, 2010 08:46AM

a[0].onsubmit=function(){};
or
a[0].attachEvent('onsubmit',function(){})

Options: ReplyQuote
Re: Setting attributes dynamically in IE6,7 and 8
Posted by: dragunov
Date: January 15, 2010 09:46AM

Hey Barbarianbob

Thanks a lot!!
Both the methods work like a charm.............:)
Cheeeeeeeeeeeerrrrrrrrrrrsssssssssss!!!!!!!!!!!!!

Options: ReplyQuote


Sorry, only registered users may post in this forum.