gpt4 book ai didi

javascript - 通过 jQuery 在 textarea 占位符内换行

转载 作者:行者123 更新时间:2023-11-28 16:35:58 25 4
gpt4 key购买 nike

我想通过 jQuery 在 textarea 中放置一个占位符,但它在 Firefox 中不起作用。

下面是我的代码:

jQuery('#orderlink_bulk').attr("placeholder","ssss /n sss");

我该怎么做?

最佳答案

如果您尝试制作多行占位符,如 W3C 文档中所述,它不受支持 http://www.w3.org/html/wg/drafts/html/master/forms.html#the-placeholder-attribute

这在带有 \n 的 Webkit 中运行良好,但在 FF 中永远无法运行 http://jsfiddle.net/kyqo9xh8/

关于javascript - 通过 jQuery 在 textarea 占位符内换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28503686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com