html文件中的按钮单击事件 [英] Button click event in html file

查看:54
本文介绍了html文件中的按钮单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我在asp.net工作..我有一个html文件也可以将它转换为aspx文件,但由于jquery文本框样式不匹配。所以我将html文件添加到我的项目中。然后它显示正确..有一个按钮''回车'',这里我想在Enter按钮上写代码...是否有可能?任何人都可以帮助我..



login.html代码:





Hi am working in asp.net.. Am having one html file also i could convert it to aspx file but the textbox styles doesn''t matched because of the jquery. So i add the html file to my project. Then it displays properly.. There is a button ''Enter'', here i want to write the code on Enter button...Is it possible?? Can anyone help me..

login.html code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IN ADMIN PANEL | Powered by INDEZINER</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="ddaccordion.js"></script>
<script type="text/javascript">
ddaccordion.init({
    headerclass: "submenuheader", //Shared CSS class name of headers group
    contentclass: "submenu", //Shared CSS class name of contents group
    revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
    mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
    defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
    onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
    animatedefault: false, //Should contents open by default be animated into view?
    persiststate: true, //persist state of opened contents within browser session?
    toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
        //do nothing
    },
    onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
        //do nothing
    }
})
</script>

<script type="text/javascript" src="jconfirmaction.jquery.js"></script>
<script type="text/javascript">

    $(document).ready(function() {
        $('.ask').jConfirmAction();
    });

</script>

<script language="javascript" type="text/javascript" src="niceforms.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />

</head>
<body>
<div id="main_container">

    <div class="header_login">
    <div class="logo"><a href="#"><img src="images/logo.gif" alt="" title="" border="0" /></a></div>

    </div>


         <div class="login_form">

         <h3>Admin Panel Login</h3>

         <a href="#" class="forgot_pass">Forgot password</a>

         <form action="" method="post" class="niceform">

                <fieldset>
                    <dl>
                        <dt><label for="email">Username:</label></dt>
                        <dd><input type="text" name="" id="" size="54" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="password">Password:</label></dt>
                        <dd><input type="text" name="" id="" size="54" /></dd>
                    </dl>

                    <dl>
                        <dt><label></label></dt>
                        <dd>
                    <input type="checkbox" name="interests[]" id="" value="" /><label class="check_label">Remember me</label>
                        </dd>
                    </dl>

                     <dl class="submit">
                    <input type="submit" name="submit" id="submit" value="Enter" />
                     </dl>

                </fieldset>

         </form>
         </div>



    <div class="footer_login">

        <div class="left_footer_login">IN ADMIN PANEL | Powered by <a href="http://indeziner.com">INDEZINER</a></div>
        <div class="right_footer_login"><a href="http://indeziner.com"><img src="images/indeziner_logo.gif" alt="" title="" border="0" /></a></div>

    </div>

</div>
</body>
</html>

推荐答案

(document).ready(function(){
(document).ready(function() {


('。ask')。jConfirmAction();
});

< / script >

< script language = javascript 类型 = text / javascript src = niceforms.js > < / script >
< link rel = stylesheet 类型 = text / css media = all href = niceforms-default.css / >

< ; / head >
< body >
& lt; div id = main_container >

< div class = header_login >
< div < span class =code-attribute> class = logo > < a href = > < img src = images / logo.gif alt = < span class =code-attribute> title = border = 0 / < span class =code-keyword>> < / a > < / div >

< / div >


< div class = login_form >

<h3>Admin Panel Login </h3>

<a href=\"#\" class=\"forgot_pass\">Forgot password</a>

<form action=\"\" method=\"post\" class=\"niceform\">

<fieldset>
<dl>
<dt><label for=\"email\">Username:</label></dt> $ b$b <dd><input type=\"text\" name=\"\" id=\"\" size=\"54\" /></dd>
</dl>
<dl>
<dt><label for=\"password\">Password:</label></dt>
<dd><input type=\"text\" name=\"\" id=\"\" size=\"54\" /></dd>
</dl>

<dl>
<dt><label></label></dt>
<dd>
<input type=\"checkbox\" name=\"interests[]\" id=\"\" value=\"\" /><label class=\"check_label\">Remember me</label>
</dd>
</dl>

<dl class=\"submit\">
<input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Enter\" />
</dl>

</fieldset>

</form>
</div>



<div class=\"footer_login\">

<div class=\"left_footer_login\">IN ADMIN PANEL | Powered by <a href=\"http://indeziner.com\">INDEZINER</a></div>
<div class=\"right_footer_login\"><a href< span class=\"code-keyword\">=\"http://indeziner.com\"><img src=\"images/indeziner_logo.gif\" alt=\"\" title=\"\" border=\"0\" /></a></div>

</div>

</div>
</body>
</html>
('.ask').jConfirmAction(); }); </script> <script language="javascript" type="text/javascript" src="niceforms.js"></script> <link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" /> </head> <body> <div id="main_container"> <div class="header_login"> <div class="logo"><a href="#"><img src="images/logo.gif" alt="" title="" border="0" /></a></div> </div> <div class="login_form"> <h3>Admin Panel Login</h3> <a href="#" class="forgot_pass">Forgot password</a> <form action="" method="post" class="niceform"> <fieldset> <dl> <dt><label for="email">Username:</label></dt> <dd><input type="text" name="" id="" size="54" /></dd> </dl> <dl> <dt><label for="password">Password:</label></dt> <dd><input type="text" name="" id="" size="54" /></dd> </dl> <dl> <dt><label></label></dt> <dd> <input type="checkbox" name="interests[]" id="" value="" /><label class="check_label">Remember me</label> </dd> </dl> <dl class="submit"> <input type="submit" name="submit" id="submit" value="Enter" /> </dl> </fieldset> </form> </div> <div class="footer_login"> <div class="left_footer_login">IN ADMIN PANEL | Powered by <a href="http://indeziner.com">INDEZINER</a></div> <div class="right_footer_login"><a href="http://indeziner.com"><img src="images/indeziner_logo.gif" alt="" title="" border="0" /></a></div> </div> </div> </body> </html>


ya possible....



u can write in



ya possible....

u can write in

<script language="javascript" type="text/javascript" src="niceforms.js">
function submit_onclick() 
{
//write ur func()
}


这篇关于html文件中的按钮单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆