javascript - how to break the long word in html? -
i'm creating list dynamically in javascript. want break long word in dot dot dot(.....). example, if word "software life cycle development" want change "software life cycl....".
and used "word-break:break-all;white-space:normal;" current output is:
software life cycle development.
can tell, how fix this? in advance.
var parent = document.getelementbyid('searchlistview'); var listitem = document.createelement('li'); listitem.setattribute('id', 'listitem_' + listid); listitem.setattribute('data-icon', 'false'); listitem.innerhtml = "<img src=" + imagesrc + " class='ui-li-icon ui-li-has-icon'></img> <a target='_black' data-role='button' href='#' id=" + listid + " name= " + url + " data-theme ='c' rel='external' data-inline='true' style='margin-left:0em; word-break:break-all;white-space:normal; ' >" + searchname + "<p style='margin-top:1px;margin-left:1px;'> file size: " + filesize + "</p></a>"; parent.appendchild(listitem);
Comments
Post a Comment