Concatenate href value and jquery result in href of anchor tag
Below is my code present in my application :
<input id="input" value="Testing" />
<a href="/captures/getTranslation/?TB_iframe=true&modal=true&height=380&width=670&" name="Signup" id="signuplink" title="Post" > Test </a>
I am posting some data to one page, i am getting all the attached parameter in my result page.
Here i want to know how do i pass text value with href of anchor tag.
I tried something like this, but it's not working :
<a href="/captures/getTranslation/?TB_iframe=true&modal=true&height=380&width=670&textBoxValue=$('#input').val();" name="Signup" id="signuplink" title="Post" > Test </a>
I have used overlay on onclick of anchor tag, if i add function over 开发者_StackOverflowthere then overlay wont come, due to that i m skipping function call on any events.
I am using jquery library also. But in result page i am not getting textBoxValue parameter.
Please suggest me guys, how to append parameter(input box value) in href attribute of achor tag using jquery
Thanks
-Pravin
Try changing the a to a button, or span and adding an onclick event, you can then redirect the users where ever you want with values from any element.
something like this:
<a onclick="javascript:GoToUrl();"> Test </a>
<script type="javascript">
function GoToUrl()
{
var url = "/captures/getTranslation/?TB_iframe=true&modal=true&height=380&width=670&" + textBoxValue=$('#input').val();
window.location.href = url;
}
</script>
精彩评论