【发布时间】:2017-10-26 03:54:13
【问题描述】:
我尝试在标题和描述框上添加一个占位符。
我已经尝试过这个脚本,但它不起作用!
希望有人能以正确的方式帮助我!
<script type="text/javascript">
$( document ).ready(function() {
$('#title').attr("placeholder", "test");
$('#description').attr("placeholder", "test");
});
</script>
<div id="item-post-title" class="item-post-title">
<label class="control-label" for="title[<?php echo osc_current_user_locale(); ?>]" style="width: auto;display: inline-block;">
<span class="required_fields">* </span>
<?php _e('Title', 'ctg_housing'); ?>
(<?php printf(__('max %s chars','ctg_housing'),$max_character_length_title); ?>)
</label> <span id="Tcounter"></span>
<?php ItemForm::title_input('title',osc_current_user_locale(), osc_esc_html( ctg_housing_item_title() )); ?>
</div>
<div id="item-post-description" class="item-post-description">
<label class="control-label" for="description[<?php echo osc_current_user_locale(); ?>]" style="width: auto;display: inline-block;">
<span class="required_fields">* </span>
<?php _e('Description', 'ctg_housing'); ?>
(<?php printf(__('max %s chars','ctg_housing'),$max_character_length_description); ?>)
</label> <span id="Dcounter"></span>
<?php ItemForm::description_textarea('description',osc_current_user_locale(), osc_esc_html( ctg_housing_item_description() )); ?>
<?php if(!osc_plugin_is_enabled('richedit/index.php')){ ?>
<?php } ?>
</div>
谢谢
【问题讨论】:
-
我不知道怎么改!
标签: javascript php html