JQuery and HTML5 Elements

I was wondering if jQuery supports HTML5 elements.

For example, I tried this code, but it failed with a rather strange error:

$('<progress value="2">').val();

It says:

TypeError: Object 1 has no method 'replace'

Is jQuery to support HTML5 elements in the future, or am I doing something wrong?

EDIT: This is not like a selector: http://jsfiddle.net/z5t3g/

+5
source share
4 answers

If you have an element <progress />in the DOM:

<progress value="2" />

You can select it using jQuery, but it seems that (since version 1.5) it does not know to return the attribute valueusing the method .val(). You need to check the attribute by name:

$('progress').attr('value');
+2

:

$('#progress').val();
+1

jquery

$("progress").val();
+1

$('progress[value=="2"]).val();

jQuery.

0

All Articles