Hi all
Still new to jQuery so I'm have problems.
I'm trying to capture and use the text in a text field after a send button is clicked this is what I have.
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script type="text/javascript" src="js/jQuery1.4.3.js"></script> <script type="text/javascript"> $(function(){ $('button').click(function(){ var name = $('#email').text(); alert(name); }) }); </script> <title>untitled</title> <style type="text/css"> *{ margin:0; padding:0; } #wrap{ margin:20px; } input{ background:#bbb; padding:.2em; } </style> </head> <body> <div id="wrap"> <input type="text" id="email"> <button>Send</button> </div> </body> </html>






Bookmarks