1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>attributeStartsWith demo</title>
6 <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
7</head>
8<body>
9
10<input name="newsletter">
11<input name="milkman">
12<input name="newsboy">
13
14<script>
15$( "input[name^='news']" ).val( "news here!" );
16</script>
17
18</body>
19</html>
20