Selecting text in an element (akin to highlighting with your mouse)

后端 未结 16 1659
孤街浪徒
孤街浪徒 2020-11-21 05:58

I would like to have users click a link, then it selects the HTML text in another element (not an input).

By \"select\" I mean the same way you would select

16条回答
  •  别跟我提以往
    2020-11-21 06:08

    According to the jQuery documentation of select():

    Trigger the select event of each matched element. This causes all of the functions that have been bound to that select event to be executed, and calls the browser's default select action on the matching element(s).

    There is your explanation why the jQuery select() won't work in this case.

提交回复
热议问题