#1
|
|||
|
|||
How to get textbox value with jQuery
Hello folks,
I would like to know, How to get textbox value with jQuery ?? NATA Delhi | Architecture Aptitude Exam Last edited by krishna mehra; 10-21-2019 at 12:15 AM. |
#2
|
|||
|
|||
If you've got an input with an id of txtEmail you can use the following code to access the value of the text box:
$("#txtEmail").val() You can also use the val(string) method to set that value: $("#txtEmail").val("something")
__________________
Newspaper Ad Agency in Delhi | Pediatric Dentist in Delhi | Book Name Change Ad in Newspaper |
#3
|
|||
|
|||
HTML Code :
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-git.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>How to get the value of a textbox using jQuery</title> </head> <body> <input type="text" value="Input text here"> </body> </html> avaScript Code : $( "input" ) .keyup(function() { var tvalue = $( this ).val(); console.log(tvalue); }) .keyup();
__________________
Dentist in Ashok Vihar | Dentist in Model Town | Dentist in Shalimar Bagh | Prosthodontist in Delhi |
Thread Tools | |
Display Modes | |
|
|