• Post Reply Bookmark Topic Watch Topic
  • New Topic

Event onclick for a button tag HTML  RSS feed

 
Dana Ucaed
Ranch Hand
Posts: 405
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Where can be stored the code of onclick for an button HTML?

I saw on many sites that If I see 'View Source fro a web page' can't see if an button have event attached.

So, I saw that in Developer Tools of a browser that can see if a button have an attached event.

Thanks a lot,
 
Stephan van Hulst
Saloon Keeper
Posts: 7932
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the HTML page links to a JavaScript file, the script may attach event handlers to the page's DOM. you should check the JavaScript files that the page links to, or <script> tags inside the HTML page.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66263
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In DevTools inspect the button element in the Elements pane. Its event listeners should be listed under the Event Listeners tab.
 
Dana Ucaed
Ranch Hand
Posts: 405
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the button has not event listed in Developer tools  can say that that button haven't events?

I inspected the Compose button for Yahoo email and I can't see any events.

But Yahoo login page is very complicated.



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66263
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you'll likely need to follow Stephan's advice and inspect the source.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!