1

Im sure this is simple question but not able to find clear information regarding how to store text in a variable? What I was hoping to do is use Jquery to replace text from a TD and covert it into a link.

For example in my table td I would get a reference number such as 20150326105 and I would like jquery to replace that text so that it converts it to the following:

http://ticketingsystem.com/UpdateNotification.asp?OEN=20150326105&CL=ALL&SU=ALL

I want to add the reference number right after the OEN=. Is this something it is possible?

2
  • 1
    Yes, it's possible. What have you tried? Commented Mar 26, 2015 at 16:32
  • 1
    We need to see the html structure of your code. Commented Mar 26, 2015 at 16:34

1 Answer 1

2

Of course this is something which is possible.

jQuery(function($) {
    var oen = $('td').text();
    var url = 'http://ticketingsystem.com/UpdateNotification.asp?OEN='+oen+'&CL=ALL&SU=ALL';
    $('td').html('<a href="'+url+'">'+oen+'</a>');
});

Is that what you were looking for? Without any code, it's hard to be sure of that.

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

1 Comment

Glad it worked! Please consider accepting this answer and also upvoting it if you feel. Happy coding!

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.