Hi All,

I am trying to add a an element(Select Box and added a function in onChange) through Javascript, which is working fine in IE6, IE7, FF and Opera. But i am failing in IE8.

If anyone has come accross this issue please help me.

here is my code

var productItems = ajaxObjects[ajaxIndex].response.split('**CREATIVE**');

var a3 = document.createElement('A');
div1.appendChild(a3);
a3.appendChild(document.createTextNode("Cancel"));
a3.onclick = function(){ couponCancel(productItems[0]); };
a3.style.textDecoration = 'underline';
a3.href = 'javascript:;';

Try replacing:

a3.appendChild(document.createTextNode("Cancel"));

with:

a3.innerHTML = "Cancel";

Also, if you ensure that couponCancel() returns false, you can get rid of the line a3.href = 'javascript:;'; , though this should have no effect on your IE8 problem.

Airshow

Try replacing:

a3.appendChild(document.createTextNode("Cancel"));

with:

a3.innerHTML = "Cancel";

Also, if you ensure that couponCancel() returns false, you can get rid of the line a3.href = 'javascript:;'; , though this should have no effect on your IE8 problem.

Airshow

Hi Airshow,

Thanks for you response, I solved it, any way thanks once again.

The code which i gave in my previous post is absolutely working fine, I did mistake in my remaining code of javascript code.

Thanks for you response, I solved it, any way thanks once again.

The code which i gave in my previous post is absolutely working fine, I did mistake in my remaining code of javascript code.

:cool:

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.