This doesnt works." />
开发者

Need to sent onclick event string var from hyperlink to javascript event function(e)?

开发者 https://www.devze.com 2023-02-28 11:03 出处:网络
Can someone tell me how i can sent a string from an onclick event to the searchfunction? onclick=\"SearchFunction(\"mystring\"); -->This doesnt works.

Can someone tell me how i can sent a string from an onclick event to the searchfunction? onclick="SearchFunction("mystring"); -->This doesnt works.

$(document).ready(function() { 
        var SearchFunction = function(e) {
            searchwords=$("#q").val();
             STR=??? -->Needs to get the string from the o开发者_StackOverflow社区nclick hyperlink.

        };
        $("#q").keyup(SearchFunction);
    });


$(this).text() should do it.

0

精彩评论

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