My html looks like this
<input type="search" id="starSearch" />
<img src="image.png" title="How to do this">
How can I change this script that will fill search field with image title attribute value? I know this code, but it's for links and innerHTML only
$(function(){
$('.special_field_link').live('click', function() {
$("#a_input_id").val($(this).html());
});
});
$(document).ready(function() {
$('img').click(function(){
$('#starSearch').val($(this).attr('title'));
})
});