Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 更改文本输入界面_Javascript_Html_Css - Fatal编程技术网

Javascript 更改文本输入界面

Javascript 更改文本输入界面,javascript,html,css,Javascript,Html,Css,我想更改文本输入字段的UI 这就是当前CSS的外观: textarea.form-textarea-user-name { width: 110px; height: 80px; text-transform: uppercase; resize: none; font-size: 18px; } function getSelectionInformat

我想更改文本输入字段的UI

这就是当前CSS的外观:

textarea.form-textarea-user-name {
    width:              110px;
    height:             80px;
    text-transform:     uppercase;
    resize:             none;
    font-size:          18px;
}
function getSelectionInformationHtml(selectionId, userName, selectionText)
{
    var selectionIdAsId = selectionId.replace(/^[^a-z]+|[^\w]+/gi, '_');
    var text = '<form name="selection-update-' + selectionIdAsId + '" onsubmit="sendSelectionInformation(\'' + selectionId + '\'); return false;">';
    text += '<span class="selectionId">' + selectionId.substring(0, selectionId.lastIndexOf(" ")) + ':</span> <textarea class="form-textarea-user-name" rows="1" cols="20" placeholder="your name">' + userName + '</textarea><textarea class="form-textarea-selection-text" rows="1" cols="50" placeholder="the new message">' + selectionText + '</textarea><button type="submit">Save</button>';
    text += '</form>';
    return text;
}
这就是脚本的样子:

textarea.form-textarea-user-name {
    width:              110px;
    height:             80px;
    text-transform:     uppercase;
    resize:             none;
    font-size:          18px;
}
function getSelectionInformationHtml(selectionId, userName, selectionText)
{
    var selectionIdAsId = selectionId.replace(/^[^a-z]+|[^\w]+/gi, '_');
    var text = '<form name="selection-update-' + selectionIdAsId + '" onsubmit="sendSelectionInformation(\'' + selectionId + '\'); return false;">';
    text += '<span class="selectionId">' + selectionId.substring(0, selectionId.lastIndexOf(" ")) + ':</span> <textarea class="form-textarea-user-name" rows="1" cols="20" placeholder="your name">' + userName + '</textarea><textarea class="form-textarea-selection-text" rows="1" cols="50" placeholder="the new message">' + selectionText + '</textarea><button type="submit">Save</button>';
    text += '</form>';
    return text;
}
函数getSelectionFormationHTML(selectionId、用户名、selectionText) { var selectionIdAsId=selectionId.replace(/^[^a-z]+|[^\w]+/gi,'.'''''.'); var text=''; text+=''+selectionId.substring(0,selectionId.lastIndexOf(“”)+:'+userName+''+selectionText+'Save'; 文本+=”; 返回文本; } 这就是我希望新文本输入的外观:

我的问题: 在脚本中的何处以及如何放置此HTML

<div class="container">

  <div class="demo-flex-spacer"></div>

  <div class="webflow-style-input">
    <input class="" type="email" placeholder="What's your email?"></input>
    <button type="submit"><i class="icon ion-android-arrow-forward"></i></button>
  </div>

  <div class="demo-flex-spacer"></div>
  <h1 class="demo">Webflow-style input</h1>
  <a class="demo" href="https://webflow.com/cms" title="Webflow CMS">https://webflow.com/cms</a>

</div>

Webflow样式输入

这里有什么问题?您可以从codepen示例复制相同的CSS,然后在javascript中修改
文本
变量以匹配codepen示例中的HTML。那会给你提供你所需要的一切吗?这里有什么问题?您的CSS正在使用自动生成的html。只要把所有需要匹配的css链接文本区域。我已经尝试了几种不同的方法。我一定是做错了。你能给我一点提示让我继续吗?我们所要做的就是你告诉我们的,你给出的所有代码都在工作,因此没有问题,我们可以帮助你。我假设这是我想要更改的字符串: