senchalabs / jQTouch

Create powerful mobile apps with just HTML, CSS, and Zepto.js (or jQuery).
http://www.jqtouch.com/
MIT License
2.79k stars 592 forks source link

get element properties or values on "tap" #512

Open ghost opened 9 years ago

ghost commented 9 years ago

I am populating a div/page from ajax and appending the elements on the div/page. when we click on any of the element i need to get the id of that element in a javascript function to send it to another div/page , to populate relevant data on the next page which is dependent on the id of the previous page. i am using the id attribute. i had used onclick function on the elements to call a javascript function but it didn't worked. if this could be done using onclick then anyone please help me or if i need to use any other feature of the jqtouch then guide me. here is the line which am using.

$('#current_screen_main_div #current_screen_div_id').append($("list ul class='rounded'> list item li class='arrow'> anchor tag a href='#next_screen_div_id' onclick='theJavascriptFunctionNeedToBeCalled();'>Test"));

but this isn't calling the function when tapping on the element.