Hidden text can be selected in IE despite style='display:none'

后端 未结 3 1920
孤独总比滥情好
孤独总比滥情好 2020-12-19 06:10

This appears to be an IE-specific \'feature\'. I tested using IE8. User John H has contributing by confirming in IE6 and IE7.

I have some text that gets built into

3条回答
  •  感动是毒
    2020-12-19 06:45

    Have you tried the visibility:collapse property?

    If the "Value I want hidden" part is used purely for computational purposes, you should use the "data" attribute.

    Like this

    Visible value

    In jQuery, HTML data attributes are automatically available via the data() api.

    You can do

    someElement.data('customValue') to read a value.

    and

    someElement.data('customValue', newValue) to set a value.

    Hope I analyzed your problem correctly.

提交回复
热议问题