0

For example I have 2 input's and one button with attribute, where i wanna use input values, it may be something like this:

<input data-link="test?input1=$('#input1'.val())&input2=$('input2.val()')" />

3
  • 2
    Not possible. Maybe if you are going to tell us what you want to do with data-link, we can propose an alternative solution. Commented Oct 2, 2011 at 13:33
  • You can't use jQuery like PHP just because of the $ Commented Oct 2, 2011 at 13:34
  • i didn't get what you're trying to do, when you're pressing a button, you want to set the attribute? Commented Oct 2, 2011 at 13:36

1 Answer 1

2

--------------Mind reading mode on---------------------

You have;

<input id='input1' type='text'>
<input id='input2' type='text'>
<input id='input3' type='text'>
<button>Copy data</button>

$(document).ready(function(){
    $('button').click(function(){
        var string = "test?input1="+$('#input1').val()+"&input2="+$('#input2').val();
        $('#input3').data('link', string);
    });
});

fiddle here http://jsfiddle.net/bGTQJ/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.