Babu Pasungily
Babu Pasungily

Reputation: 315

how to select child element with particular class name using jqlite in angularJs?

Actually angular js doesn't recommend using jquery for DOM manipulation but it provide basic dom manipulation using jqlite(extended from jquery with limited operation) but if i want to select a child element of target element,it can be easily done using jquery but jqlite doesn't support selector in children() method.. how can i do that using jqlite .

In jquery,this is possible

$(this).children('.class_name');

But in jqlite this is not possible

angular.element(event.target).children('.class_name');

Is there any other way doing it?

Upvotes: 3

Views: 2664

Answers (1)

mrak
mrak

Reputation: 2906

You can just use querySelector:

event.target.querySelector('.class_name');

As far as I remember event.target is DOM element and querySelector is widely supported http://caniuse.com/#search=queryselector

Upvotes: 3

Related Questions