Assign an ID to the search input
Assign an ID to the search input
fangy
Posts: 2Questions: 1Answers: 0
Hello,
i'm unable to assign via Jquery an ID to the input search ( i neet to get the value for php use).
$('#tabella_filter label input').on("focus", function(event){
$('#tabella_filter label input').attr('id', 'cerca');
});
this doesnn't work.
Some suggesions?
thanks in advance
This discussion has been closed.
Answers
You want to assign an id on focus? Unusual, but fair enough :-). The code you have should work, although you could do
this.setAttribute( 'id', 'cerca' );
in the event handler.Allan
well, i've tried to assign even without the binding 'on', but without success. :(
and again, it doesn't works :(
To tell the truth, the code
$ ('# tabella_filter label input').attr ('id', 'search');
if entered from the console after page loading, it works! but not if executed in page.
Seems to work entirely as expected for me: http://live.datatables.net/wojumuva/1/edit .
Please link to a test case showing the issue.
Allan