给你一个 j印古典问题。 I m 创建由几个不同的文本投入领域组成的旁边际工具。 该工具的目的是在模板上打印。 我试图将数据输入实地交换,但我会遇到问题,把数据输入我的 j子。 这是我所铭记的:
$( myInputField ).(function(){
$(this).onChange(){
// write to variable X
}
});
基本上,我希望投入中我打什么打字,然后我可以放弃对我数据库的改动。
给你一个 j印古典问题。 I m 创建由几个不同的文本投入领域组成的旁边际工具。 该工具的目的是在模板上打印。 我试图将数据输入实地交换,但我会遇到问题,把数据输入我的 j子。 这是我所铭记的:
$( myInputField ).(function(){
$(this).onChange(){
// write to variable X
}
});
基本上,我希望投入中我打什么打字,然后我可以放弃对我数据库的改动。
是否只是投入领域的关键活动是不够的?
j 质量:
$( textarea ).keyup(function() {
$( #foo ).html($(this).val());
});
传真:
<textarea></textarea>
<div id="foo"></div>
$( #myInputField ).(function(){
$(this).onkeyup(){
x = this.value;
}
});
or more succinctly:
$( #myInputField ).onkeyup(){
x = this.value;
});
You re just looking for the value that s in myInputField
within that event handler? Something like this?:
$( myInputField ).(function(){
$(this).onChange(){
x = $(this).val();
}
});
如果<代码><>><>>ts已经成为一个 j物体,我就不记得我的头顶。 如果是的话,那么这项工作应当奏效,或许可以略微绕过:
x = this.val();
Additionally, you can explicitly reference the field with a normal jQuery selector if this
is ever overridden with a different context, or if you want to reference other fields as well, etc.:
x = $( myInputField ).val();
问题在于,在IEC,onchange
activity don t work on INPUT elements. 因此,您必须使用<条码>的关键>条码>或<条码>。 取决于你们想要做的事情。
JS way:
document.getElementById( myInputField ).onblur = function() {
var x = this.value
}
jQuery way:
$( #myInputField ).blur(function() {
var x = this.value
})
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.