how to add javascript & Jquery for productattributes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi
  I want to call Js when input button click event in .cshtml partial view. Please anyone can help!
11 years ago
It's a bit hairy but you can do it.  You need to add some jquery to _ProductAttributes.cshtml to register an event handler for those attributes.  There are variables in that view that are the ID for each attribute so make sure you use that and not a class or something.  Otherwise you'll get odd events happening when you have two or more variants on a page with the same attribute.
11 years ago
yes, by using Javascript function as follow in Productattributes.cshtml
<script type="text/javascript">
    $(document).ready(function () {
....................
........
}
    });

</script>
Welcome!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.