开发者

Creating html button link - not working

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜