这是我的 javascript 和 html 代码。
function convertinput() {
document.getElementById('first').value
var string = document.getElementById('first').value
var newString = "@@[0:1: " + string + "]]"
document.getElementById('output').value = newString
}
<input id="first"></input>
<br>
<input id="output"></input>
<br>
<input type='button' onclick='convertinput()' value='convert'>
jsfiddle中的代码编辑器是http://jsfiddle.net/FEC7S/3/
我希望此代码显示在我的博客文章中,因为它在这里 http://www.trickiezone.com/2012/10/facebook-blue-text-generator-by.html
如果我通过 jsfiddle 或tinkerbin 将其嵌入到我的博客中,则会显示整个网页。
我只需要在我的博客文章中显示结果。
如何做到这一点?
最佳答案
我已经在我的博客中添加了工作演示:
待办事项:
1)登录您的博客。
2)添加新帖子
3)粘贴此代码
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<script language="javascript" type="text/javascript">
function convertinput() {
document.getElementById('first').value
var string = document.getElementById('first').value
var newString = "@@[0:1: " + string + "]]"
document.getElementById('output').value = newString
}
</script>
<input id="first"></input>
<br>
<input id="output"></input>
<br>
<input type='button' onclick='convertinput()' value='convert'>
</div>
关于javascript - 在 Blogger 帖子中显示 Javascript 和 HTML 的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13122245/