+ Start a Discussion

Fixing Reflected XSS issue

I'm trying to add JSENCODE into the the <div> onclick function but I am getting an error: Incorrect argument type for function 'JSENCODE()'. : Markup

Here is the code on my Visualforce component  - strKeySet is just a string/text
<apex:repeat value="{!arKeySet}" var="strKeySet">
    <div class="section">
        <div class="header">
            <div id="Plus_{!strKeySet}" class="IconPlus slds-float--left Plus{!strKeySet}" onclick="console.log('{!JSENCODE(strKeySet)}'); return false;">
            <div id="Minus_{!strKeySet}" class="IconMinus slds-float--left Minus{!strKeySet}" style="display: none;" onclick="console.log('{!JSENCODE(strKeySet)}'); return false;">
            <apex:repeat value="{!objLastestEventsForVF[strKeySet]}" var="objLatestEvent">
                <div class="column1 slds-float--left">
                        <apex:outputText value="{!objLatestEvent.strTempName}" title="{!objLatestEvent.strTempName}"/>

Please help. Thanks