我想写一个文字,在用户点击所有提交纽芬兰语时,即写出以下Jquery书,对所有观点都说不错,但并不奏效:
$(document).ready(function () {
$(":input[type=submit]").click({
this.attr( disabled , disabled );
});
})
So what is wrong wiht my code? BR
我想写一个文字,在用户点击所有提交纽芬兰语时,即写出以下Jquery书,对所有观点都说不错,但并不奏效:
$(document).ready(function () {
$(":input[type=submit]").click({
this.attr( disabled , disabled );
});
})
So what is wrong wiht my code? BR
$(document).ready(function () {
$("input[type= submit ]").click(function() {
$(this).prop( disabled , true);
});
});
或
$(document).ready(function () {
$("input[type= submit ]").click(function() {
this.disabled = true;
});
});
If the submit button is submitting a f或m, you will have to prevent the default action that will reload the page:
$("input[type= submit ]").click(function(e) {
e.preventDefault();
$(this).prop( disabled , true);
});
});
如何做这样的事情:
$(document).ready(function () {
$("form").submit({
$("input[type=submit]").attr( disabled , disabled );
return true;
});
});
以上是你打算做些什么的更好办法。 如果你坚持要求您的守则发挥作用,则删除“条码”:条码>,然后在“条码”上填写。
你们说,你想让所有各州都感到不舒服,但“这”关键词仅指导致这一事件被推翻的项目,因此你需要:
$(document).ready(function () {
$("input[type= submit ]").click({
$("input[type= submit ]").attr("disabled","disabled");
});
});
The reason your script doesn t work is because this
is referring to the HTML element, not the jQuery object. You need to wrap it in a jQuery object to run functions such as attr
on it:
$(this).attr( disabled , disabled );
此外,如果你想要打听all<>/strong>提交纽芬兰语,那么你就需要做新的选择,并且可以全部放弃。 这部法律应当做到:
// Passing a function to $ will run it on document ready
$(function () {
$("input[type=submit]").click({
// Select all submit inputs and disable them
$( input[type=submit] ).attr( disabled , disabled );
});
});
现在,当有人被点击时,所有提交纽芬兰语的人都应残疾。
我认为,这是你期待的:
$("input[type=submit]").click(function() {
$(this).attr( disabled , disabled );
// if you want to disable all buttons on the form do the following
// $("input[type=submit]").attr("disabled", "disabled");
});
<><>Edit>:
adeneo是正确的。 使用<代码>prop(<>方法”可能是一个好的想法。 我从来没有过通过<条码>(残疾、残疾)代码”来消散的问题,但我听到有人提到这个问题。
然而,这一格丽论坛职位在,please-explain-attr-vs-prop-change-in-1-6上,可能进一步解释人们在使用倾斜方法时有分歧的原因。 她们最有可能成为现实而不是残疾。
不含“:”投入选择器的提炼,使用美元。
$(function () {
$("input[type=submit]").click(function() {
$(this).attr( disabled , disabled );
});
})
FYI——我用短手提子为美元(文件)。 准备就绪。
The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...
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 am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...
I have a div <div id="masterdiv"> which has several child <div>s. Example: <div id="masterdiv"> <div id="childdiv1" /> <div id="childdiv2" /> <div id="...
I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.
I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...
Ok, I m stumped. Basically, this script works fine in FF, but not in IE (6,7 or 8) - in which it returns an "Object doesn t support this property or method" error. Any ideas?: function ...
What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...