I wonder how I can select a specific element in the DOM using VueJS with our without jquery
In my component I have a method function that does this:
$(".u-loc input").focusin(function() {
$(".u-loc-icon").addClass('blue-active');
});
The only problem is that its generated dynamic, so I could have 1 or 10 different which means I need to have a uniqe selector to each one.
So I have added :ref="'u-loc' + index"
Which means that I can now target the element using $(this.$refs['u-loc' + index]);
But I dont know how I can chain the selector to look something like this:
$(this.$refs['u-loc' + index]).('input').focusin(function() {
$(this.$refs['u-loc' + index]).addClass('blue-active');
});
The problem is that I need to select the elements [input]