How to access textbox ids with page id in JQM

I have the same id on two different pages in JQM.

Question:

How can I access this identifier with page identifiers as you know, in JQM each page has its own id:

$('#pageId #textfieldId').val(); 

Or something different?

+4
source share
3 answers

Use the code below to get the value of the text area on the active page.

 $.mobile.activePage.find('textarea').val(); 
+2
source

Instead:

 $('#pageId #textfieldId').val(); 

Using:

 $('.pageId .textfieldId').val(); 

You can only run a unique identifier

+2
source
 $('#pageId').find('textfieldId').val(); 
+1
source

Source: https://habr.com/ru/post/1484708/


All Articles