[SalesForce] How to use Custom label in an onClick Javascript button

Hii I need to use a custom label in my onClick javascript button.

I am getting an error

Field $Label.Label does not exist. Check spelling.

Though I have already Created the Custom Label

The label I am using is like

alert('{!$Label.Tax_Code_Input}');

and it should display the word

GST out 10%

as an alert .Please guide me how to use a custom label in javascript

Best Answer

Use like this :

alert('{!$Label.Test_CS1}'); 

OR

alert('{!JSENCODE($Label.Test_CS1)}');

The alert must work

Snap shot of alert :

enter image description here