jQuery Core

 Posted by Sheonarayan on 7/21/2011 | Category: jQuery Interview questions | Views: 4102 | Points: 40
Answer:

jQuery accepts a string enclosed with double quote (“”) that can contain a CSS selector which is used to match a set of elements on the web page.

jQuery code can start with either “jQuery” word or a “$” (dollar symbol). Take a look at below code snippet

<script language="javascript" type="text/javascript">

$(function () {
jQuery("#div1").css("border", "2px solid red");
});
</script>


OR

<script language="javascript" type="text/javascript">

$(function () {
$("#div1").css("border", "2px solid green");
});
</script>


Both above code snippets are functionally same and do the same thing. So you can either user jQuery or $ when you are writing jQuery code.


Source: http://itfunda.com/jquery-how- | | Alert Moderator 

Comments or Responses

Login to post response