【发布时间】:2013-02-17 23:03:13
【问题描述】:
我正在做这个项目,我按下一个按钮,将在文本区域中查找特定单词(可能将光标移动到该特定单词)。我尝试了很多东西,但到目前为止没有运气。 这就是我想要做的。
$line ="<html>
<head>
<title>Drum studio home</title>
<body>
<img src="/images/fo.png" alt=""/>
</body>
</html> ";
textArea 在 php 页面中,test.php
<textarea name="tvalue" id="tvalue">
<?php
echo $line . "\r\n";
?>
</textarea>
<input type="submit" value="find next" name="submit"/>
当我运行 test.php 时,我会在 textarea 中看到以下内容。
<html>
<head>
<title>Drum studio home</title>
<body>
<img src="/images/fo.png" alt=""/>
<img src="/images/fo.png" alt="fo image"/>
</body>
</html>
**find next** --- this is the button
查找下一个按钮将查找没有替代文本的任何图像。 我知道我需要 js 或 jquery。我是新来的。所以真的不知道从哪里开始。请帮忙。 谢谢
【问题讨论】:
-
你想完成什么?在您的 html/php 文件中找到没有
alt属性的img标签? -
是的,在 html/php 文件中没有 alt 属性的 img 标签和没有 alt 属性的 img 标签在 textarea 内。
标签: php javascript