Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 13, 2009 06:47 PM by PraveenaReddyName
Member
91 Points
271 Posts
Nov 13, 2009 03:13 PM|LINK
I am really struggling getting started with jquery, i cant get anything to work appart from an alert message
function handlesClick() { $("table#mytable").addClass("label"); } </script>
why doesnt that work?
can give me a step by step example of something very very simple that will work, just to change the color of something or something
thansk in advance
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Nov 13, 2009 03:21 PM|LINK
Hi,
there are plenty of little samples over at docs.jquery.com. Like for example this one: http://docs.jquery.com/Attributes/addClass#class.
Also I would rather write
$("#mytable tr td").addClass("somegreatbackgroundcolorclass");
than
$("table#mytable")
Where mytable is the id of the table you want to target.
Grz, Kris.
Contributor
4392 Points
883 Posts
Nov 13, 2009 05:58 PM|LINK
<div id="clickme">click me!</div> <div id="mytable">text</div> <script type="text/javascript"> $(document).ready(function(){ $("#clickme").click(function(){ $("#mytable").addClass("class").css("font-size", "15pt") }); }); </script>
jquery is very nice to use definitely go to jquery.com
407 Points
69 Posts
Nov 13, 2009 06:47 PM|LINK
<script type="text/javascript" src="../../Scripts/jquery-1.3.2.js"> </script>
[ Try using this line before the line "<script type="text/javascript">" ]
Like this: <script type="text/javascript" src="../../Scripts/jquery-1.3.2.js"> </script>
<script type="text/javascript">
function Ex(){ alert('Example'); }
</script>
erics44
Member
91 Points
271 Posts
jquery with mvc
Nov 13, 2009 03:13 PM|LINK
I am really struggling getting started with jquery, i cant get anything to work appart from an alert message
function handlesClick() {
$("table#mytable").addClass("label");
}
</script>
why doesnt that work?
can give me a step by step example of something very very simple that will work, just to change the color of something or something
thansk in advance
XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: jquery with mvc
Nov 13, 2009 03:21 PM|LINK
Hi,
there are plenty of little samples over at docs.jquery.com. Like for example this one: http://docs.jquery.com/Attributes/addClass#class.
Also I would rather write
$("#mytable tr td").addClass("somegreatbackgroundcolorclass");
than
$("table#mytable")
Where mytable is the id of the table you want to target.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
tgmdbm
Contributor
4392 Points
883 Posts
ASPInsiders
MVP
Re: jquery with mvc
Nov 13, 2009 05:58 PM|LINK
<div id="clickme">click me!</div> <div id="mytable">text</div> <script type="text/javascript"> $(document).ready(function(){ $("#clickme").click(function(){ $("#mytable").addClass("class").css("font-size", "15pt") }); }); </script>jquery is very nice to use definitely go to jquery.com
PraveenaRedd...
Member
407 Points
69 Posts
Re: jquery with mvc
Nov 13, 2009 06:47 PM|LINK
<script type="text/javascript" src="../../Scripts/jquery-1.3.2.js"> </script>
[ Try using this line before the line "<script type="text/javascript">" ]
Like this: <script type="text/javascript" src="../../Scripts/jquery-1.3.2.js"> </script>
<script type="text/javascript">
function Ex(){ alert('Example'); }
</script>