Html
<div mycolor="green">
Hello!
</div>
JavaScript
// find element by attribute mycolor
var elem = $("[mycolor]");
// elem = div
Html
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- HTML Elements -->
<div mycolor="green">
Hello!
</div>
<!-- JavaScript -->
<script>
// the page has opened
$( function()
{
// looking for an element by attribute & attribute value
var elem = $("[mycolor]");
// Show an element on the page
alert(elem.html());
// Hello!
});
</script>
</body>
</html>