I have a code like this in my view:
<div id="price"> 2000000 </div>
I want a Javascript code that add "," for each three digits from right and in my code it's should be: 2,000,000
I'm beginner in javascript and i seen a few topics about this code and none of them was complete (with html codes) , please explain how i use this javascript code in my html code How can I do this?