-1

如何在工具提示中编写 php 代码(变量)这是我的代码:-

<head>
<link type="text/css" rel="stylesheet" href="css/screen.css" media="screen"  />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>  
<script type="text/javascript" src="js/chilltip-packed.js"></script>
<script type="text/javascript">
$(function() {

$('.ChillTip').ChillTip();
$('.ChillTip1').ChillTip({ 
CTBK:'#fff', 
CTBC:'#000',    
CTW:'150'
});
});

</script>
</head>
<body>
<?php
$abc= 'Urvisha';
?>

<a href="chilltip" class="ChillTip1" title="&#60;span class=&#34;one&#34;&#62;Blue&#60;&#47;span&#62;, &#60;span class=&#34;two&#34;&#62;Pink&#60;&#47;span&#62;, &#60;span class=&#34;three&#34;&#62;Green&#60;&#47;span&#62;, &#60;span class=&#34;four&#34;&#62;Purple&#60;&#47;span&#62;, &#60;span class=&#34;five&#34;&#62;Red&#60;&#47;span&#62;, &#60;span class=&#34;six&#34;&#62;Yellow&#60;&#47;span&#62;">For more info.</a>
<button class="ChillTip" title="This is a button example">BUTTON</button>

</body> 

如果我在 title="" 中写入 $abc ,我想要工具提示中的 $abc 然后 $abc 显示的不是它的值请帮助我.....

4

1 回答 1

1

您只需要将变量回显到 HTML 中:

<button class="ChillTip" title="<?php echo $abc?>">BUTTON</button>
于 2013-06-19T04:18:43.203 回答