DOM properties / methods that are not available in jQuery?

In response to my question about jQuery.get (), I was wondering if there is a list of DOM properties and methods that are not available in jQuery, which can only if you are working with a raw DOM object (for example, $ ("# someID"). Get (). scrollHeight;)

+4
source share
5 answers

I have not seen the list, but if it existed, it would probably be quite long. In addition to browser-specific properties, there are tons of other less useful properties and methods that jQuery does not currently abstract. But then I really do not see this as a problem or even the right point of discussion, because jQuery IS JavaScript; if you need access to anything other than what jQuery provides, you can use get() or access the specified element in one of your "jQuery collections", for example an array:

 jQuery(elem)[0].someDOMProperty; 

Plus jQuery provides absolutely no support for non-element nodes in the DOM. If for any reason you need direct access to comment nodes, text nodes, etc., then you will need to use the "raw" DOM.

+4
source

I don’t know the compiled list of DOM operations / properties that are NOT available in jQuery (and a quick google search didn’t call anything), but if you go to http://api.jquery.com/ you can see the whole API and even load it like an Adobe AIR application if you don’t have the Internet when you need it.

0
source

Each attribute of each element is accessible through the attr() function. If you can do document.getElementById() on this element and then access the property, you can also do this with the attr() function. However, when using jquery, some properties are more easily accessible in other ways. For example, to see if an element is hidden or invisible, you can do:

 var isVisible=$("#el").is(":visible"); 

instead of using the attr() method. Similarly, you can find selectedIndex drop-down lists and the text of the selected parameter is easier than using the attr() method. This pdf describes some of these simpler approaches.

To access the css property, you better do:

 var fontWeight=$("#el").css("fontWeight"); 

instead of using get() or attr() . You can also set css properties this way, for example:

 $("#el").css("fontWeight","bold"); 
0
source

No. JQuery is just JavaScript. If you can do it in JavaScript, you can do it in jQuery. Some properties and methods are overwritten in the context of the jQuery object, and that where you would like to get the get () method is the "get" (i.e., access) standard property / method.

It really is as hard as it is.

0
source

I may be wrong, but I think that you can access any properties using the attr method.

-1
source

All Articles