jquery - how to generate cross button(&times) through javascript - Stack Overflow

The following doesn't generate a 'cross' or (X) in the browser.closeLink.text("&

The following doesn't generate a 'cross' or (X) in the browser.

closeLink.text("×");

What should be set here to display the 'X' mark.

The following doesn't generate a 'cross' or (X) in the browser.

closeLink.text("×");

What should be set here to display the 'X' mark.

Share Improve this question asked Jun 29, 2015 at 18:32 user2599052user2599052 1,1463 gold badges16 silver badges34 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

× is an HTML entity.
You can either set the element's HTML (not text) to HTML source with that entity, or set the text directly by passing ×.

For those who found this but are not using jQuery:

closeLink.innerHTML = '×'

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745461646a4628733.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信