搜索栏不显示 rel 标签
我设置了一个 rel 标签来在搜索栏中显示一些文本。 由于某些奇怪的原因,它没有在主页上显示文本: http://www.horecavacaturebank.nl/
<input type="text" id="search" title="" name="s" class="text placeholder" rel="Alle vacatures" value="" />
<input type="text" id="near" title="Locatie" name="location" class="text placeholder" rel="Locatie" value="" />
我在“Bekijk CV's”页面上使用相同的代码,实际上正在工作: http://www.horecavacaturebank.nl/cv/
<input type="text" id="search" title="" name="s" class="text placeholder resume-search" rel="CV's zoeken" value="" /
我已经花了大约 2 个小时来解决这个问题我认为现在是向你们寻求帮助的好时机。 提前致谢!
编辑:它似乎与 jquery 文件有点冲突。 如果我删除以下行,搜索栏可以工作,但滑块不再工作:
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.4.3.min.js"></script>
I have set a rel tag to display some text in my searchbar.
For some odd reason it does not show the text on the homepage:
http://www.horecavacaturebank.nl/
<input type="text" id="search" title="" name="s" class="text placeholder" rel="Alle vacatures" value="" />
<input type="text" id="near" title="Locatie" name="location" class="text placeholder" rel="Locatie" value="" />
I use the same code on the "Bekijk CV's" page, which is actually working:
http://www.horecavacaturebank.nl/cv/
<input type="text" id="search" title="" name="s" class="text placeholder resume-search" rel="CV's zoeken" value="" /
I already spent like 2 hours to fix this and think this is the good time to ask you guys for help.
Thanks in advance!
EDIT: It apears that it kinda conflicts with the jquery file.
If i delete the following line, the searchbar works, but the slider wont anymore:
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.4.3.min.js"></script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@昆汀是对的。您不应将
rel
属性用于input
元素。您可以使用一些简单的 jQuery 来获得您想要的效果
您设置值,这些值显示在输入中。当您关注任一输入时,该值将被删除。一旦输入失去焦点,如果字段中没有添加任何内容,则该值将再次放回原处。
http://jsfiddle.net/2HY7y/
@Quentin is right. You should not use a
rel
attribute for aninput
element.You could use a simple bit of jQuery to get the effect you want
You set the values, which shows in the input. When you focus in on either input, the value is removed. Once the input loses focus, if there is nothing added to the field, the value is placed back again.
http://jsfiddle.net/2HY7y/
您可以尝试http://code.google.com/p/jquery-watermark/
You can try http://code.google.com/p/jquery-watermark/