1

When I try to add this line of code :

onclick="document.getElementById('part3').style.display='';return false;"

Into a link it disables the other function for some reason.. This is the code in which i would like to add the above code:

a href="javascript:DecreaseQuantity('PROD_VK_1.4')">

Works fine until i add the code, then only the onclick function works not the javascript part.

How can I fix this?

Dave Chen
  • 10,887
  • 8
  • 39
  • 67

1 Answers1

0

Try this,

<a href="javascript:DecreaseQuantity('PROD_VK_1.4')" onclick="doFunction()" />

function doFunction() {
    document.getElementById('part3').style.display='';
    return false;
}

or:

function doFunction() {
    if ($("#part3").css("display", "")) {
        return false;
    } else {
        return true;
    }
}
Nicolas
  • 1,125
  • 1
  • 15
  • 31