select a data from list and store in a variable in phonegap android <p>hi I new to phonegap android in I had created a list using jquery which contains data from local database. know what i want to do is select a data from list and to store that selected list in variable. the code for creating list is here </p> <pre><code>function getdata(){ db.transaction(function(tx) { tx.executeSql(selectdata,[],function(tx,results){ $('#name').empty(); for(var i=0;i&lt;results.rows.length;i++){ $('#name').append('&lt;li id="s1" onclick="selectname()"&gt;&lt;a href="#"&gt;&lt;h3 class="ui-li-heading"&gt;'+results.rows.item(i).nameR+'&lt;/h3&gt;&lt;/a&gt;&lt;/li&gt;'); //parent.location='file:///android_asset/www/editpage.html'; } }); }); </code></pre> <p>}</p> <pre><code>function selectname(){ var strnme=document.getElementsByClassName("ui-hi-heading").value; alert("Data Selected is"+strnme); </code></pre> <p>}</p>