jquery - How to link in javascript? -
how can link in javascript, want link suggestion.full #
js:
var domains = ['hotmail.com', 'gmail.com', 'aol.com']; var topleveldomains = ["com", "net", "org"]; $('#email').on('blur', function(event) { console.log("event ", event); console.log("this ", $(this)); $(this).mailcheck({ domains: domains, // optional topleveldomains: topleveldomains, // optional suggested: function(element, suggestion) { // callback code console.log("suggestion ", suggestion.full); $('#suggestion').html("did mean? <b><i>" + suggestion.full + "</b></i>?"); }, empty: function(element) { // callback code $('#suggestion').html('no suggestions :('); } }); });
html:
<label for="email">e-mailadres</label> <input type="email" name="email" id="email" /> <p id="suggestion"></p>
i tried:
$('#suggestion').html("did mean? <b><i>" + <a href="#">'suggestion.full</a>' + "</b></i>?");
thanks in advance
you've got quote placement , type mixups. try instead:
$('#suggestion').html('did mean? <b><i><a href="#">'+suggestion.full+'</a></b></i>?');
if suggestion.full
url, can add href this:
$('#suggestion').html('did mean? <b><i><a href="'+suggestion.full+'">'+suggestion.full+'</a></b></i>?');
Comments
Post a Comment