I've the input buttons without any class or id and have onclick attr on that something like this:
<input type="button" onclick="myfunc();" />
And there are other input type buttons too and want to style to the buttons which have onclick attribute.
So, here I can do like this:
input[onclick="myfunc();"]{color: red;}
But in the onclick there may be any function like myfunc(), thisfunc(), or anyfunc().
So how can I select those input buttons which have onclick attribute.
The value can be omitted:
input[onclick]{color: red;}
On an unrelated note, this seems like an interesting use case. I would probably use something like this, perhaps styling the border or something instead of the text, in order to highlight form elements (or any other elements) with event handler attributes, for "debugging" purposes.
$(function(){
$("#mybutton").click(function(){
$(this).css("color","red");
});
});
You can also JQuery for your solution. Add attribute id="myButton" to your input button.