Django button ajax click

后端 未结 1 1255
-上瘾入骨i
-上瘾入骨i 2021-01-21 11:15

I have some HTML that Django is rendering well. I\'d like to click a button on the HTML and have that cause an event to fire in the view.

It doesn\'t look like the butt

1条回答
  •  攒了一身酷
    2021-01-21 11:56

    Is there a reason Why you are not using the click event directly?

    Try this:

    
    

    If the button is dynamically created then you may want to use the bind function to attach click event handler to the element:

    
    

    Try this URL to include the JQuery library:

    
    

    0 讨论(0)
提交回复
热议问题