In-depth understanding of html form input monitoring_HTML/Xhtml_web page production

WBOY
Release: 2016-05-16 16:46:01
Original
1673 people have browsed it

I saw a blog post about input events today, and I sorted out the relevant information on a whim.

Event:

function changeVal(value){    console.log($(value).val())}
Copy after login

onchange: The onchange event is triggered after the content before and after changes and the focus is lost.

<input type="text" value="" onchange="changeVal(this)">
Copy after login

oninput: The oninput event will be triggered when the value changes.

<input type="text" value="" oninput="changeVal(this)">
Copy after login

There is also an onpropertychange event, which has a similar effect to oninput, but is exclusive to IE! And it didn't work during the test, so I was confused. . .

Supplement:

When oninput and onpropertychange fail:

oninput event:

(1) When the value is changed in the script, it will not be triggered;

(2) When selecting from the browser’s automatic drop-down prompt, it will not be triggered;

onpropertychange event:

When input is set to disable=true, it will not be triggered.

The above is the in-depth understanding of HTML form input monitoring that the editor has brought to you. I hope you like it~

If you want to know more game activities and game strategies, please continue to pay attention to this site. The editor of this site will bring you the best, most fun, and freshest game information as soon as possible. More exciting content, all in the jb51 game channel!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!