Search code examples
jqueryjquery-mobilejquery-mobile-listviewjquery-filter

get the id of a filter in a list jquery-mobile


this will create a listview with a input search for filter, i would like to know if it s possible to give an id to the input search or not (i would like to set some value in with a listener when tap on a button).

<ul id="listeDesMedecinsUl" data-role="listview" data-filter="true"data-filter-placeholder="enter a name"  data-inset="false" data-split-icon="gear" data-divider-theme="a">

Thanks sry for my english


Solution

  • You can access it in this way"

    $('[data-type="search"]').val()
    

    example: http://jsfiddle.net/Qg69F/