jQuery addClass example

Change class name on click in jQuery

by Aditya Sharma

HTML

<input type="text" id="sampleInput" placeholder="&#xF6E3;" />

CSS

input#sampleInput::-webkit-input-placeholder {
    font-family: "Material Design Icons";
}

JavaScript

/* $('#sampleInput').attr('placeholder',"&#xF6E3;"); */

function hex2a(hexx) {
    var hex = hexx.toString();//force conversion
    var str = '';
    for (var i = 0; (i < hex.length && hex.substr(i, 2) !== '00'); i += 2)
        str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
    return str;
}
console.log(hex2a("&#xF6E3;"));