How does input get where he dynamically sets his drop-down box throughout the page when he gets focus?

<input type="text" @focus="searchOPSFocus(index)" :placeholder="validateObj.operation_name" v-model="submitData.operation_name[0]">
...
<ul class="ops-search-wrap">
      <li>123</li>
      <li>123</li>
      <li>123</li>
    </ul>


there are many input in the page. To enter keywords and pop up the search drop-down box, I want to get the position of this input in the page through the searchOPSFocus method, and then dynamically set the ops-search-wrap location, but print this event and do not find the data I want? What"s the reason.

May.26,2022

In the

target attribute, there are two properties offsetLeft and offsetTop you can do what you want to do with them

https://blog.csdn.net/zh_rey/...

Menu