I want to parse an an element and set the area by currency.
HTML:
<span id="price">¥82,84</span><br/>
Javascript:
price = document.getElementById("price").innerHTML;
price = price.slice(0,1);
if(price == "€")
{
area = "europe";
}
if(price == "£")
{
area = "europe";
}
if(price == "\$")
{
area == "northamerica";
}
if(price == "\¥")
{
area == "asia";
}
Euro and Pounds are working, but Yen and Dollar not. Does anyone have an idea?
You are using equality comparison
==in the statements where you should use assignment operator=.