English 中文(简体)
JQuery Change text on button Point "flashes” the text
原标题:JQuery change text on button click "flashes" the text
  • 时间:2010-01-29 05:45:18
  •  标签:
  • jquery

EDIT:

感谢古斯-完美! 我希望我能够检查不止一个答案,因为你都给我正确的答案。 快速反应!


我有以下职责:

$(document).ready(function(){ 
      $( #login_btn ).click(function(){
        $("#message").text("button was pushed"); 
    }); 
});

它是在我点击 but子时,电文的改动。 但是,当装货时,它立即又回去。 因此,你们真的看到是一场快速的闪光,然后又走了。

我使用密码。 上面的文字称为“login_attempt”,在我的项目根基中被称作“javascript”。 这是该档案中唯一的事情。 下面是产出来源html。

<html>
<head>
    <script language="javascript" src="path to jquery-1.4.min.js"></script>
    <script type="text/javascript" src="path to login_attempt.js"></script>

    <title>Login Page</title>
</head>
<body>
    <div id="message">this will become something else</div>
      <button id="login_btn">Click Me</button>
</html>

我现在就学习了“Qu”,但我认为,在修改案文时,应该保持改动。 能否告诉我如何确保改变?

感谢。

最佳回答
$( #login_btn ).click(function(){
    $("#message").text("button was pushed");
    return false;
}); 

拒绝提交表格。

问题回答

该纽顿在形式上吗? 如果是的话,我想在你点击纽顿时再提交表格,然后重新上载。 这很可能重载如此之快,似乎就象闪电一样。

$(document).ready(function(){ 
    $( #login_btn ).click(function(e){
        e.preventDefault();
        $("#message").text("button was pushed"); 
        return false;
    }); 
});

加上虚假的返回,基本上阻止了纽特人通常会开始的事件链。





相关问题
getGridParam is not a function

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 )...

selected text in iframe

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.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

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.

jConfirm with this existing code

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"; } ...

Wrap text after particular symbol with jQuery

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: &...

热门标签