Use onchange in a div

Rafael Morais dos Santos picture Rafael Morais dos Santos · Jul 13, 2011 · Viewed 47.8k times · Source

Is it possible to use onchange event in a <div>?

Because my <div> changes its text inside.

Can I do something like this?

<div id="name" onchange="calculateTotal();"></div> 

Answer

duskwuff -inactive- picture duskwuff -inactive- · Jul 13, 2011

No; the onchange attribute is only applicable to form field elements (input, select, textarea, etc).