With id="btn" added to the button you are usually doing something such as:
<script>
$(document).ready(function(){
$("#btn").click(function(){
// whatever you want...
});
});
</script>
ie you define a function that runs once the page is loaded and that will attach a function to this button for its click event to tell what should be done when it happens.
Or uou have a particular problem ? F12 Console or F12 Network can help to better see what happens before trying to solve the exact problem you found.
According to your description, I couldn’t understand your requirement clearly.
As patriceSc said, If you want to fire the click event, you only need to put the event below jquery function.
$(function () {
$("").click(function () {
});
})
wmec
$('form').submit(function(e) {
The submit() Method display an alert when a form is submitted.
If I misunderstand your requirement, please post more details information about your requirement.
Best regards,
Sam
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Contributor
6479 Points
5815 Posts
Enable event
Mar 12, 2020 06:48 AM|wmec|LINK
Hi,
How to enable click event to button below
to call this?
Peter
All-Star
48570 Points
18082 Posts
Re: Enable event
Mar 12, 2020 07:39 AM|PatriceSc|LINK
Hi,
With id="btn" added to the button you are usually doing something such as:
ie you define a function that runs once the page is loaded and that will attach a function to this button for its click event to tell what should be done when it happens.
Or uou have a particular problem ? F12 Console or F12 Network can help to better see what happens before trying to solve the exact problem you found.
Edit: try perhaps https://www.w3schools.com/jquery/default.asp if needed.
Contributor
3370 Points
1409 Posts
Re: Enable event
Mar 12, 2020 08:21 AM|samwu|LINK
Hi wmec,
According to your description, I couldn’t understand your requirement clearly.
As patriceSc said, If you want to fire the click event, you only need to put the event below jquery function.
The submit() Method display an alert when a form is submitted.
If I misunderstand your requirement, please post more details information about your requirement.
Best regards,
Sam
All-Star
58254 Points
15678 Posts
Re: Enable event
Mar 12, 2020 03:45 PM|bruce (sqlwork.com)|LINK
assuming the button is inside the form change to submit:
if its outside the form its: