css - How do I update the text of a div inside of a table/form in Jquery inside of a dialog box? -


I have a device inside the table which is inside a form that I would like to update

  & lt; Form id = "login_form" method = "post" action = "#" onsubmit = "return false;" & Gt; & Lt; Table & gt; & Lt; Tr & gt; & Lt; Td> Username & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "name" id = "login_name" & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td> Password & lt; / Td> & Lt; Td> & Lt; Input type = "password" name = "password" id = "login_password" & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td> & Lt; Input type = "checkbox" name = "keep_logged" id = "login_keep" checked & gt; & Lt; / Td> & Lt; Td> Keep me logged in on this computer & lt; / Td> & Lt; / TR & gt; & Lt; Tr & gt; & Lt; Td colspan = 2 & gt; & Lt; Br> & Lt; INPUT type = "submit" name = "submit" value = "submit" onclick = "submitLogin ();" & Gt; & Lt; INPUT type = "reset" name = "cancel" value = "cancel" id = "login_cancel" & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td colspan = 2 & gt; & Lt; Div id = "result_div" & gt; & Lt; / Div & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Form & gt;  

I have tried several ways to update that div, but I can not seem to do this work. For example:

  $ ("div # result_div"). Html ("My text has changed!"); $ ("# Result_div") Html ("My text has changed!"); Document.getElementById ('result_div'). InnerHTML = 'My text has changed!';  

I have tried to convert it from a div to a period with the same result if I work fully in the div / text update out of the table, then I am quite It is clear that my code is being well-developed.

Any assistance will be apperciated.

Thank you.

EDIT: I realized that it is inside a Jquery-ui dialog box, I'm sorry to officially omit that piece of information.

Your code snippet works for me, so there is nothing wrong with what you are doing. is. You have omitted some important details from the surrounding code ...

  • Where are you trying to update? $ ("# result_div") will only work if you have & lt; Script & gt; down

    gt; Or if you do it with $ (document) .ready (...) callback function so it is executed only after the page is loaded.

  • If the $ ("# result_div"). If you display Html then there is only one element with id = "result_div" , right?

  • () After setting it up immediately, is it set correctly?

  • Do you see any javascript errors in your browser's JS error log / console from other scripts on the page?

  • You can see the XHTML & lt ;! DOCTYPE & gt; Not giving page with ? Or with application / xhtml + xml MIME type?

  • What if you just do warnings ($ ("# result_div")?) ?


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -