10 examples of 'jquery select by name' in JavaScript

Every line of 'jquery select by name' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
17function selectall(name) {
18 if ($("#check_box").attr("checked")==false) {
19 $("input[name='"+name+"']").each(function() {
20 this.checked=false;
21 });
22 } else {
23 $("input[name='"+name+"']").each(function() {
24 this.checked=true;
25 });
26 }
27}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

127function getSelector(name) {
128 return (class_names[name] ? "." + class_names[name] : null);
129}
23function getElementsByNameSelectorsApi(name) {
24 return this.querySelectorAll("*[name='" + name + "']");
25}
13function getElement(name) {
14 return $(name + '-dialog');
15}
4112function getElementsByName(
4113 doc,
4114 name
4115 )
4116 {
4117 /*
4118 Public wrapper method for
4119 `getElementsByName`; returns
4120 `null` if not applicable.
4121 */
4122 var isDoc = Utils.is.document(doc),
4123 key = "getElementsByName",
4124 canUse,
4125 result = null;
4126 if (isDoc) {
4127 canUse = Utils.is.hostObject(
4128 doc[key]
4129 );
4130 if (canUse) {
4131 result = makeLinearArray(
4132 doc[key](name)
4133 );
4134 }
4135 }
4136 return result;
4137 }
227static tagName(name) {
228 return By.css(name);
229}
67function select(selectAll) {
68 var lists = $('.deplistContent.active ul');
69 for (var i = 0; i < lists.length; i++) {
70 var checks = lists[i].getElementsByTagName('input');
71 for (var j = 0; j < checks.length; j++) {
72 if (checks[j].id === 'common') {
73 continue;
74 }
75 checks[j].checked = selectAll;
76 }
77 var lis = lists[i].getElementsByTagName('li');
78 for (var n = 0; n < checks.length; n++) {
79 if (checks[n].id === 'common') {
80 continue;
81 }
82 lis[n].className = (selectAll) ? 'active' : '';
83 }
84 }
85 updateCommand();
86 return false;
87}
221getElementsByTagName(element /** TODO #9100 */, name) {
222 return element.getElementsByTagName(name);
223}
118getElementsByTagName(element: any, name: string): any[] {
119 return [];
120}
198function $(name) {return this.document.getElementById(name);}

Related snippets