By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,060 Members | 1,230 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,060 IT Pros & Developers. It's quick & easy.

onclick="javascript:document.location= alternative

P: 1
hi i have a css style button with following code,

but my cms seems to be stripping the javascript , is there some alternative to link the button?

Expand|Select|Wrap|Line Numbers
  1. <h2 class="black-first-title"><button class="button yellow" onclick="javascript:document.location='/joomla/index.php/webshop/cart/add?quantity[0]=1&amp;virtuemart_product_id[0]=11&amp;virtuemart_category_id[0]=2'">
  2. <div class="title">buy now</div>
  3. <div class="price">120 €</div>
  4. </button>
Apr 20 '15 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,639
I would drop the event attributes completely in favour of properly coded event handlers in the JS section (<script> tags or includes)
Apr 20 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.