Q:

Issue with title for image in jquery mobile

am having the following code, in which the title is not displaying totally when putting cursor on it, if title is given as "The Value", the title is shown only as only "The" and not "The Value". Can someone let me know whats the mistake.Please.
var str1 = "The Value";
var str;
if (str1.length > 10) {
                        str = str1.substring(0, 10);
                        str = str + "...";
                    }

<li><div id=' + itemId + ' class="append_content" title=' + str1 + '><div class="append_pic"><img style="width:54px; height:54px;" src='+icon+'></div><div class="append_text">' + str + '</div></li>

A:

You are lacking the proper encapsulation for your attribute definitions. It is required to write ="'+ variable+'" if the variable contains spaces. Please observe: 
title=' + str1 +'

should be 
title="'+ str1 +'"

and you should do this for all other attributes, as well.

