No, I’m not concerned about the additional spaces in Gmaps, it’s going to the correct address anyway. My concern is having those line breaks and the span in the presentation of the address, that little jQuery function computes the address into the link, then also outputs the address inside the anchor tag without the `` or ` ` tags.
I know so little about jQuery that it has me stumped..I was thinking I might be able to prepend an anchor tag with the values computed into gmaps, then append the closing anchor tag, but I really don’t know where to start..
Ohhh…you mean that you want the address in the browser as it’s coded and not shoved into a string.
That being the case, I think the best thing to do is to have a set of spans (address lines if you will), let the JS grab the text inside each one and the concatenate all of that….then only submit it to GMaps on a click.
I confess I’m at an early stage with JQuery but that would seem to be the logical way to do it.
Edit: I just realised I completely missed the point of what you’re trying to accomplish! Didn’t spot your original codepen, will have a look at that as well, but the text input turned into a link is pretty cool also!
Perfect, @CrocoDillon had the solution. Just swapping the `$(this).text()` with `$(this).html()` did it.
I have an input for the client to put in an address field similar to an online form, and the output on the page was what my pen was, span and line-breaks auto populated. But that jQuery I had was removing the line breaks and span tag.
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".