Per Richard's comment, if you know the tag names of the elements that
will match the class (like div, p), you can do the following:
$("div,p").filter(function(){
var classes = $(this).attr("className").split(" ");
var found = false;
for (var i = 0; i < classes.length; i++)
Don't forget that elements can have more than one class (each separated by a
space), so such a test will only pass if it's the first in the list.
- Richard
On Tue, Nov 11, 2008 at 6:22 PM, Rik Lomas <[EMAIL PROTECTED]> wrote:
>
> To get a class that begins with 'rate', you can do
> $('*[classNam
To get a class that begins with 'rate', you can do $('*[className^="rate"]')
Note that the attribute is className, not class
$('*[className^="rate"]').each(function () {
alert( $(this).attr('className').split('rate')[1] );
});
2008/11/11 debussy007 <[EMAIL PROTECTED]>:
>
>
> Hi,
>
> How is i
Try
$('[class^=rate]');
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of debussy007
Sent: Tuesday, November 11, 2008 3:15 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] get the class that starts with ...
Hi,
How is it possible to get the
4 matches
Mail list logo