开发者

Creating html button link - not working

开发者 https://www.devze.com 2023-02-08 18:58 出处:网络
very quick question. I have a href link like so in my template. <a href={% url tiptop.views.client_items name.pk %}>add item</a>

very quick question. I have a href link like so in my template.

<a href={% url tiptop.views.client_items name.pk %}>add item</a>

This works But if I wanted it to create it as a button for some reason it does not work.

<input type="button" on_click="window.location.href='{% url tiptop.views.client_items name.pk %}>开发者_高级运维</a>'" value="Add item">

I don't understand why it does not work. Basically, the button shows, but when I click on the button it does NOTHING.


Try:

   <a <!--...your link code here -->
   <input type="button" onClick="window.location.href='{% url tiptop.views.client_items name.pk %}'" value="Add item"/></a>

Your Quotes the single and the double one where not closed properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消