Every decent programming start with a"Hello, world!" example, before you can start writing your own code,but just to make sure that everything is working, and for you to see how simple jQuery is, let's kick off with a little example:
<div id="divExample1"></div>
<script type="text/javascript">
$("#divExample1").text("Hello, world!");
</script>
$ is shortcut to access jQuery.
Same above example implemented using JavaScript without help from jQuery.
<div id="divExample2"></div>
<script type="text/javascript">
document.getElementById("divExample2").innerHTML = "Hello, world!";
</script>
Output:
Hello,world!
Post your comments / questions
Recent Article
- How to programmatically modifying the AppSetting value in web.config using c#?
- TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
- How to calculate the age from jQuery ui datepicker using c#?
- How to calculate days difference between two dates in c#?
- Changing date format in jQuery ui datepicker
- How to set value to nicedit textarea using jQuery?
- How to load data from json file in angular?
- cannot find module consider using '--resolvejsonmodule' to import module with json extension angular
Related Article