Monday, 18 September 2017
javascript - jquery - access form input field by Name
Answer
Answer
Is it possible to access an form input field using just the element name?
If I were attempting this with the ID, it would look like this:
$("#fname").blur(function(){
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
});
Is there any way to get access the element using the name is the field were??:
Answer
To do this the correct selector is
$('input[name=fname]')
Subscribe to:
Post Comments (Atom)
casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV
In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...
-
Parse error: syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' ...
-
I'm using Simple HTML DOM to extract data from a HTML document, and I have a couple of issues that I need some help with. On the line th...
-
I've just started to learn CodeIgniter and gotten trouble with example below: My Controller: class Site extends CI_Controller ...
No comments:
Post a Comment