antonlab
antonlab

Reputation: 343

What HTML elements can be made clickable with javascript?

I just started learning JavaScript and one of the first pieces of codes I've come across is onclick.

The only example I've seen it being used in are form buttons for example:

<input type="button" onclick="checkName()" value="Check name" />

I'm curious as to what other html elements can be made clickable to run javascript?

It would be great if you could list every possible type, thanks!

Upvotes: 0

Views: 843

Answers (2)

Vic
Vic

Reputation: 112

onclick can be used with the following tags:

<a> <abbr> <acronym> <address> <area> <b> <big> <blockquote> <body> <button> <caption>     <center> <cite> <code> <col> <colgroup> <dd> <del> <dfn> <dir> <div> <dl> <dt> <em> <fieldset> <form> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <map> <menu> <noframes> <noscript> <object> <ol> <optgroup> <option> <p> <pre> <q> <s> <samp> <select> <small> <span> <strike> <strong> <sub> <sup> <table> <tbody> <td> <textarea> <tfoot> <th> <thead> <tr> <tt> <u> <ul> <var>

edit.. Its easier to say wich ones do not support onclick:

<base> <bdo> <br> <head> <html> <iframe> <meta> <param> <script> <style> <title>

Upvotes: 1

Chrysi
Chrysi

Reputation: 121

Every element can be made clickable.

Upvotes: 3

Related Questions