Avatar ·

How to select an element by name attribute using jQuery?

Hello everyone! I just started learning jQuery and ran into a problem. I have a form on the page with several input fields, and I need to get the value of a specific field using its name attribute. In plain JavaScript I would use `document.getElementsByName('username')`, but in jQuery I can't find an equivalent. Here's an example of my HTML: ```html
``` I'm trying to do something like: ```javascript $('#myForm').find('input[name="username"]').val(); ``` But it doesn't work, and I get undefined. I've tried different