DAD*_*ADU 7 javascript html5 contenteditable execcommand
使所选文本变为粗体:
document.execCommand('bold', null, null);
Run Code Online (Sandbox Code Playgroud)
当用户再次选择那段文本(或其中的一部分)时,您怎么知道它已经变得粗体?
大胆只是一个例子.的commandName可能是underline,heading,createLink,...
DAD*_*ADU 12
Run Code Online (Sandbox Code Playgroud)document.queryCommandState确定是否已对当前选择执行给定命令.
资料来源:http://blog.whatwg.org/the-road-to-html-5-contenteditable#how
显然我搜索得不够好.
| 归档时间: |
|
| 查看次数: |
2406 次 |
| 最近记录: |