< input type= "hidden" name= "blk" onchange= "test ();" value= "" / >
Why is the onchange event not triggered when the value in blk changes when using the js script, and how can the test () method be executed?
< input type= "hidden" name= "blk" onchange= "test ();" value= "" / >
Why is the onchange event not triggered when the value in blk changes when using the js script, and how can the test () method be executed?
onchange event can only be triggered when the content of the input box changes when the input box loses focus. I guess you want to listen for the input event, please use onkeyup, so that each input character will trigger the event.
input event ~ or trigger ('change')
onchange is triggered only after it gains focus and then loses focus. Direct dom manipulation assignment can extend jquery, to add a _ val
method instead of jq's own val
$.fn.extend({_val:function(newVal){
var originalVal = $(this).val();
if(newVal!==originalVal) {
$(this).val(newVal);
$(this).trigger("change");
}
}})
use $('input [name = blk]'). _ val (12345)
when assigning a value to input.
if you look at your scene, you don't have to extend jQuery as above. If there are only one or two uses, you can also use val
assignment and trigger the event directly by calling trigger ("change")
. It's just a little ugly.
description: a regular match is given to the content of an input box, and the matching content is the product activation code. looks like this: "0C31-0B81-BB32-3094-0C31-0B81-BB32-3094 " Code: $( -sharplicenseCode ).keyup(function () { le...
I configured the MIME type of the file with the amr suffix in the apache configuration as application ms-download, Why it is a garbled page when opening a file in amr format using window.open in chrome, while a file in amr format can be successfully dow...
what does the code circled in the following picture mean? ...
adopt a reward of 10 yuan, 1045 Access denied for user root @ localhost (using password:NO) recently, when I was at the front end of my self-study, I came into contact with a little bit of database. This happened when I made a new connection on ...
there is an h5 page embedded in the encapsulated APP. After the function of issuing an order, how can I get the user s id to add the address and place the order ...
A similar question, I want to know how to deal with the number of correct answers. I originally wanted to declare a variable and then decide to add it when the answer is right, but not if it is wrong. But what is printed is always 0 and 1 ....
make an answer system, trigger the click event on the answer page (choose the correct answer), and add 1. No mistakes. Now the whole answer is finished. Jump to another page, that is, the answer completion page, how can I get the value of the correct ans...
use Wechat public platform JSSDK to develop Wechat sharing function! Every time I use the company s public platform account, I report a signature error! There is nothing wrong with the account of the public platform developed by myself! I would like to...
the background gives me an interface to tell me the parameters to be passed, and how to click Save to save the address information entered by the user to the address list ...
when I click the button to select a region, there will be three addresses of provinces, cities and regions. I got the value through .html, but the parameters required by the background are separated by city and county. What do I do with the data segmen...
this is the HTML corresponding to this part ...
in the laravel project, when using the blade template, you often use @ section ( style ) on the page. <style type="text css"> < style> @ endsection or @ section ( script ) <script type="text javascript"> &...
the project uses jq+bscroll.js, because there are some pages that need to show chart data, so echart.js, uses a column chart (the data can slide left and right when the data is too long), resulting in problems with the original page sliding 1 if the f...
to write several mobile pages, you need to use the components provided by ant design mobile to develop. How to use this thing, the document doesn t understand much at first and which of the two ways mentioned above should be used, ah, to find a so...
...
for example, (- 1) get 225 ...
str+= < div class= "mui-input-row mui-radio mui-left " > ; str+= < label > set to default < label > ; str+= < input name= "radio1 " type= "radio " checked class= "moren " id= + data.data [I] .id + > str+= < div > use mui s butt...
when our website is opened on the computer side, Baidu news often appears at the bottom of the page. I don t know what this is caused by, is it the code? Did we drive it on our own initiative? Or are there some problems with the settings of the operato...
console.log (pic) merchandise address this is the address of the printed picture http: www.zhani.com Uploads. $( .tu img ). Attr ( src , +pic+ ); how to put pic into it, ask for great help, try many ways are not correct ...
var uid = users.id; console.log(uid); ID console.log(returnCitySN["cip"]);ip if (uidsand undefined) {} $(function () { page rendering $.ajax ({) type: POST , dataType: "json", url: "URL ", data: {ip:returnCitySN [...