In my product description text I have the following code for a size chart button that, when clicked, opens up a new smaller new window with the size chart for that item.
<button onclick=”myFunction()”>View Size Chart</button>
<script>
function myFunction() {
var myWindow = window.open(“http://www.thegirlway.com.au/wp-content/uploads/2016/11/Screen-Shot-2016-12-08-at-6.25.50-PM-1-1024×528.png”, “”, “width=663,height=300”);
}
</script>
The button works fine, however when I edit the product in any way (title, picture, price, quantity ect) it changes the first line of code to <button>View Size Chart</button>, so when you click the button it does nothing. If I change the code back to the original coding the button works again as normal.
This is happening with every single one of my products that have a size chart. I also use a few different size charts and it is happening with all of them so doesn’t appear to be related to the image itself.
Can you advise why this piece of code would be automatically changing when I edit the product and also how I can prevent this from happening every time I edit a product.
Thanks