admin管理员组

文章数量:1425851

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 = '×'

本文标签: jqueryhow to generate cross button(amptimes) through javascriptStack Overflow