[英]I want to add the placeholder attribute to the input within this DIV but it does not have a unique property that I could locate it with
我无法直接编辑HTML,因为Squarespace不允许这样做,只能使用JS和Jquery。
$("#field city :input").attr('placeholder', 'City');
我尝试使用此功能,但不起作用
<div class="field city">
<label class="caption"><input class="field-element field-control" name="" x-autocompletetype="" type="text" spellcheck="false" data title="">
</label>
</div>
提前致谢
检查这个js小提琴 ..
<div class="field city">
<label class="caption"><input class="field-element field-control" name="" x-autocompletetype="" type="text" spellcheck="false" data title="">
</label>
</div>
<script>
document.getElementsByClassName('field-element')[0].placeholder='city'
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.