开发者

JQuery - Click Link Auto fill in input field

开发者 https://www.devze.com 2023-02-12 20:55 出处:网络
I got a bit of a pickle. What im trying to do is click on a link and it automatically puts a value into an input field.

I got a bit of a pickle.

What im trying to do is click on a link and it automatically puts a value into an input field.

I have an quicksearch table that auto sorts when you type something in the search box. I want to be able to click a link with a specific name that automatically puts t开发者_如何学JAVAhat value in the search field.

So far i have this

$(document).ready(function() {

$('#test').click(function() {
    $('.qs_input').val( $(this).text() ).keyup();
    return false;

    });

});

Cheers,


This should do it:

$('#yourLink').click(function() {
    $('#yourInput').val( $(this).text() ).keyup();
    return false;
});
0

精彩评论

暂无评论...
验证码 换一张
取 消