[英]HTML Image tag doesn’t render table properly assigned to title attribute
I am trying to assign table to image's title property using javascript but when I hover over the image it doesn't render a table instead it displays the table as text. 我正在尝试使用JavaScript将表格分配给图片的title属性,但是当我将鼠标悬停在图片上时,它不会呈现表格,而是将表格显示为文本。
function FormatAssessorInfo(P1, P2)
{
var ToolTipTable = "<table width='200px' border='0' cellspacing='0' cellpadding='2'> <tbody> <tr> <td> Phone: </td> <td> " + P1 + " </td> <td> Cell: </td> <td> " + P2 + " </td> </tr> </tbody> </table>";
return '<img src="/files/404048/93171/Info-32.png" height="15" width="15" title="' + ToolTipTable + '" style=""/>';
}
This is not possible with what you're trying. 您尝试的操作无法做到这一点。 You may want to use some
tooltip
plugin for that. 您可能要使用一些
tooltip
插件。 Like jQuery tooltips
. 像
jQuery tooltips
一样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.