Modify ↓
Ticket #6780 (closed bug: invalid)
HTML/character entities not handled
| Reported by: | kbwood | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | attributes | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The attr and val functions don't handle/convert HTML and character entities. For example:
$('#input').attr({title: 'søntag'}).val('søntag');
shows this exact text instead of resolving ø to ø.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

This seems compatible with the behavior of the underlying DOM apis, so I don't think it's a bug:
$('input')[0].value = 'søntag'; $('input')[0].setAttribute('title', 'søntag');If you need to translate HTML entities to text, it's easy enough:
var text = $('<div />').html('søntag').text();