target.id回答。我非常感谢你的帮助。致以最良好的祝愿。非常感谢你帮助我。我也能通过James Allardice的e.target.id答案得到我所设定的。我非常感谢你的帮助。顺致敬意, <!-- jQuery.support.cors =
target.id回答。我非常感谢你的帮助。致以最良好的祝愿。非常感谢你帮助我。我也能通过James Allardice的e.target.id答案得到我所设定的。我非常感谢你的帮助。顺致敬意, <!-- jQuery.support.cors =,jquery,onchange,Jquery,Onchange,target.id回答。我非常感谢你的帮助。致以最良好的祝愿。非常感谢你帮助我。我也能通过James Allardice的e.target.id答案得到我所设定的。我非常感谢你的帮助。顺致敬意, <!-- jQuery.support.cors = true; // needed for ajax to work in certain older browsers and versions $(document).ready(function(){ $(this).chang
target.id回答。我非常感谢你的帮助。致以最良好的祝愿。非常感谢你帮助我。我也能通过James Allardice的
e.target.id
答案得到我所设定的。我非常感谢你的帮助。顺致敬意,
<!--
jQuery.support.cors = true; // needed for ajax to work in certain older browsers and versions
$(document).ready(function(){
$(this).change(function(){
alert('form element changed!');
});
}); // end .ready()
//-->
// Sarfraz
$(this).change(function(){
var id, name, value;
id = this.id, name = this.name, value = this.value;
alert('id=' + id); // this returns 'undefined'
alert('name=' + name); // this returns 'undefined'
alert('value=' + value); // this returns 'undefined'
});
//
// rjz
$(this).change(function(){
var $this = $(this),
id = $this.attr('id'),
name = $this.attr('name'),
value = $this.val();
alert(id); // this returns 'undefined'
alert(name); // this returns 'undefined'
alert(value); // this returns blank
});
// Jamie
$(this).change(function(){
var id = $(this).attr('id');
var name = $(this).attr('name');
var value = $(this).attr('value');
alert('id=' + id); // this returns 'undefined'
alert('name=' + name); // this returns 'undefined'
alert('value=' + value); // this returns 'undefined'
});
//
//James Allardice
$(this).change(function(e) {
var elem = e.target;
alert('elem=' + elem); // this returns 'objectHTMLTextAreaElement'
});
//
// Surreal Dreams
$("#my-form input").change(function(){
alert('form element changed!');
var value = $(this).val();
var id = $(this).attr("id");
var name = $(this).attr("name");
alert(id); // nothing happens
alert(name); // nothing happens
alert(value); // nothing happens
});
//
//Jamie - Second Try
$('.jamie2').each(function() {
$(this).change(function(){
var id = $(this).attr('id');
alert(id); // nothing happens
});
});
//
$("#myform input").change(function(){
alert('form element changed!');
var value = $(this).val();
var id = $(this).attr("id");
var name = $(this).attr("name");
});
var ELEMEMT = $('#IDOFELEMENT').val();
$(this).change(function(){
var id = this.id,
name = this.name,
value = this.value;
});
$(this).change(function(){
var $this = $(this),
id = $this.attr('id'),
name = $this.attr('name'),
value = $this.val();
});
$(document).on('change','#myID',function(){
alert('Id:'+this.id+'\nName:'+this.name+'\nValue:'+this.value);
});
$(this).change(function(){
var id, name, value;
id = this.id; name = this.name; value = this.value;
});
$(this).change(function(e) {
var elem = e.target;
});
$(this).change(function(e) {
var elemId = e.target.id;
});
$('.class_name').each(function() {
$(this).change(function(){
var id = $(this).attr('id');
});
});
$('.class_name').click(function() {
$(this).change(function(){
var id = $(this).attr('id');
});
});
$("#myform").on('change', input, (function(){
alert('form element changed!');
var $this = $(this);
var value = $this.val();
var id = $this.attr("id");
var name = $this.attr("name");
});