我想如何使用悬停来svg路径标题节目?
$( "path" ).click(function() {
$("#country").val($(this).attr('title'));
$( "#target" ).submit();
});
某些SVG代码:
<path id="IE-CW" title="Carlow" class="land" d="M458.79,501.13L460.38,501.38L461.8,500.65L463.58,502.11L463.79,502.83L464.9L457.76,504.49L457.53,501.71L458.46,501.86z"/>
答案 0 :(得分:0)
Instead of using title attribute, use a nested title element.
Use the below code:
<path id="IE-CW" title="Carlow" class="land" d="M458.79,501.13L460.38,501.38L461.8,500.65L463.58,502.11L463.79,502.83L464.9L457.76,504.49L457.53,501.71L458.46,501.86z">
<title>Carlow</title>
</path>