jquery - append typed text to link url ( live ) - demo included -
Hello I'm just making user profiles, and thought that they would be allowed to add a Facebook link to their profile, and Click or preview it, or look in the modal window, but it's a bit easier.
Basically, I want the user to type a Facebook ID in the Input box, show a preview and then type the typed text to the href. Link to the link so that it can test url on click.
JS:
$ (function () ($ (". FacebookID") keyboard (function () {var facebookID = $ (this) .val () ; $ (". FacebookID_preview"). HTML (facebookID); return false;}}}}); Basically, I want to add the typed text to the href link If you type stackoverflow, then
What about adding
< Code> $ ("div a") .attr ("href", "http://facebook.com/" +. $ (". FacebookID_preview") text ()); Return False Before the statement? Note that the link selector may be one The actual webpage should be a bit more specific in the environment ...
Comments
Post a Comment