Prev Demo
jQuery
>
Element[Attribute~='Value' - Attribute Contains Value In Mid
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <input id="txtName" type="text" data-id="txtName" /> <input id="FirstNameLast" type="text" data-id="Name txt" /> <input type="button" value="Button" id="btnTest" /> <script> $(function () { $("input[data-id~='Name']").css("border", "1px solid red"); // $("input[id*='Name']").css("border", "1px solid green"); }); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output