jquery函数不起作用 [英] jquery function not working
本文介绍了jquery函数不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
i已经制作了一个jquery函数,当我们专注于文本框时,它的背景颜色应该会改变,但它不起作用看看我的代码
< script 类型 = text / javascript src = jquery / jQueryv1.9.1.js > < / script > ;
< script type = text / javascript >
$ ( document )。ready( function (){
$(' TextBox')。focus( function (){
$( this )。css(' background-color ',' #cccccc');
});
});
< / script >
< asp:TextBox ID = TextBox1 runat = 服务器 CssClass = TextBox meta:resourcekey = TextBox1Resource1 > < / asp:TextBox >
帮助将受到高度赞赏
解决方案
( document )。ready( function (){
(' TextBox')。焦点( function (){
( this )。css( ' background-color',' < span class =code-string>#cccccc');
});
});
< / script >
< asp:TextBox ID = TextBox1 runat = 服务器 CssClass = TextBox meta:resourcekey = TextBox1Resource1 > < / asp:TextBox >
帮助将受到高度赞赏
hello,
i have made one jquery function, in which when we focus on textbox its background color should change, but its not working have a look on my code
<script type="text/javascript" src="jquery/jQueryv1.9.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('TextBox').focus(function(){
$(this).css('background-color', '#cccccc');
});
});
</script>
<asp:TextBox ID="TextBox1" runat="server" CssClass="TextBox" meta:resourcekey="TextBox1Resource1"></asp:TextBox>
help will be highly appreciated
解决方案
(document).ready(function(){
('TextBox').focus(function(){
(this).css('background-color', '#cccccc'); }); }); </script> <asp:TextBox ID="TextBox1" runat="server" CssClass="TextBox" meta:resourcekey="TextBox1Resource1"></asp:TextBox>
help will be highly appreciated
这篇关于jquery函数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文