0

Here I have a name of places by google places api:

var ime=place.name;

and I call this string (object name) with tooltip into title tag:

content: '<div title='+ime+' class="kikonica" data-toggle="tooltip" data-placement="right"><img src='+image+'</img></div>'

but on hover I only see first word of title so first word of place name...

etc. if name is: King Burger restaurant on hover I only see King

Why? How I can solve that?

1 Answer 1

2

When ime is a single word and you do

title = ' + ime + '

it works good and fine but when its more than a single word the space splits it up and hence you need to concat that using a double quote as i did below

Try this

content: '<div title="'+ime+'" class="kikonica" data-toggle="tooltip" data-placement="right"><img src='+image+'</img></div>'
Sign up to request clarification or add additional context in comments.

1 Comment

This works, but would you explain why it works as well, to better inform the OP.

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.