August 14, 2011

$(“.class”) returns object

jQuery $(“.class”) returns object

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

<h3 class=”divClass”>Hello world! text</h3>
<p class=”divClass”>Hello world paragraph text.</p>
<p>This is another paragraph.</p>
<label>Try to mouseover and then mouseout on here</label>

JQuery $(“.class”) returns object as we have
var obj = document.getElementByClassName(‘domObjClasses’);

But this returns array.

var obj = document.getElementById(‘domObjId’);

Here we will have an object by Id.

Last updated: March 19, 2014