Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery how to select all the class elements start with "text-"?

I have got some classes

.text-1 .text-2 .text-3 

I want to select them all, how to do that? Thanks for the help

like image 845
user469652 Avatar asked Nov 12 '10 05:11

user469652


People also ask

What is $() in jQuery?

$() = window. jQuery() $()/jQuery() is a selector function that selects DOM elements. Most of the time you will need to start with $() function. It is advisable to use jQuery after DOM is loaded fully.

Which is the correct jQuery selector to select all elements?

The #id Selector The jQuery #id selector selects an HTML element based on the element id attribute. Following is a simple syntax of a #id selector: $(document).


1 Answers

Try this. For more details refer jquery selectors

$('*[class^="text"]') 
like image 90
Chinmayee G Avatar answered Sep 23 '22 00:09

Chinmayee G