0

i'm trying to replace all jquery with jqlite so my problem is like this

<div id="mainDiv">
    <br>
    <div class="childDiv">
        <input type="hidden" id="hdn" value="test1" />
    </div>
    <br>
    <div class="childDiv">
        <input type="hidden" id="hdn" value="test1" />
    </div>
    <br>
    <div class="childDiv">
        <input type="hidden" id="hdn" value="test1" />
    </div>
    <br>
</div>

the div childDiv were added dynamically from javascript

in jquery we can use like this:

angular.element(document.querySelector('#mainDiv')).children('div')
    .on('click', function () {
        temp = $(this).find('input[type="hidden"]');
    });

i want to replace $(this) since it is a jquery with jqlite like this : temp=angular.element(document.querySelector(this)).find('input[type="hidden"]'); but it doesn't work..please help..any idea?

1 Answers1

0

You should enclose the id in double quotes, like

<div id="mainDiv">
Vivek
  • 11,938
  • 19
  • 92
  • 127