Use jQuery select() to select contents of a div

前端 未结 4 1539
耶瑟儿~
耶瑟儿~ 2020-12-10 07:48

Is it possible to use or adapt jQuery\'s .select() to set a selection range on the entire contents of a div?

I have a div which has a series of labels, inputs, selec

4条回答
  •  无人及你
    2020-12-10 08:09

    If you want to select inside form elements. Use .focus() /.blur() and .val() functions.

     $('input').focus(); //focus on input element
     $('input').val(); //return the value of input
    

提交回复
热议问题