I don't know how to use any mask money outside of the input.   $(function() {   $('.currency').maskMoney().focus();  });   Works  &lt;input type="text" name="amount" class="currency" value="1000000" /&gt;   Not Works  &lt;span class="currency"&gt;5000000&lt;/span&gt;
715
I would like to format a price in JavaScript. I'd like a function which takes a float as an argument and returns a string formatted like this: &quot;$ 2,500.00&quot;  What's the best way to do this?
112644
How do I make the cross-browser (including Internet Explorer 6) transparency for the background of a div while the text remains opaque?  I need to do it without using any library such as jQuery, etc. (But if you know of a library that does it I'd love to know so I can look at their code).
117147
myInput.value is one keystroke behind when I examine it in a keyPress event handler. So if the users types &quot;a&quot;, myInput.value gives me &quot;&quot;. Then when the user types &quot;b&quot;, myInput.value gives me &quot;a&quot;, and so on. The value doesn't seem to get updated with the character input by the keystroke that triggered the event. What am I doing wrong?
54234
I'm pretty accustomed to clearing my floats by using &lt;br style="clear:both"/&gt; but stuff keeps on changing and I am not sure if this is the best practice.   There is a  (from positioneverything) available that lets you achieve the same result without the clearing div. But... they claim the hack is a little out of date and instead you perhaps should look at . But.. after reading through 700 pages of comments :) it seems there may be some places the latter hack does not work.   I would like to avoid any javascript hacks cause I would like my clearing to work regardless of javascript being enabled.   What is the current best practice for clearing divs in a browser independent way?
84776
I was just curious if there's a way to get input not from StdIn but from $EDITOR - be it vim, nano, emacs or even a non-command-line-editor (MacVim/TextMate). What are the options/workarounds/bestpractices?  Basically I'd wish for a workflow as with heredoc - but from the $editor instead.   $ sort -nr &lt;&lt; FOO | uniq -c  pipe heredoc&gt; foo  pipe heredoc&gt; bar pipe heredoc&gt; baz pipe heredoc&gt; foo pipe heredoc&gt; FOO    2 foo    1 baz    1 bar
121056
We can't seem to get the ligthning:inputField to work with time type fields (NOT date\time). Does anyone know if it should work?  Other types such as picklists, checkboxes etc work just fine.
75776
This is a very silly question since nobody will actually do this because it makes very little sense in the real world but I just want to know how would it actually work if possible.  For example let us take an amount of 2 dollars and 2 cents and multiply that buy 2 dollars and 2 cents. Would the result be 4 dollars and 4 cents? The only way to make sense out of this for me is to treat them as vectors and multiply components.
18964
I'm looking for a way to get the Default currency symbol (in a none-multi-currency org) of the salesforce org locale (to have it displayed on a visualforce page in a field that can't be &lt;apex:inputField&gt; or &lt;apex:outputField&gt;) preferably query-able from apex (via the database, a describe or whatever) and then again the actual symbol, meaning € for Euro, $ for dollar, and so on...  There must surely be some sort of mapping hidden in the code somewhere salesforce does this via the input/outputfields if bound to an sobject of type currency  Can anyone point me in the right direction?
98525
In  my question () contains a "$" in a quoted section of the question.  Originally I had a second "$" in a second quoted  section of the same question.    However when I did this the second $ seemed to trigger a style that made the text italic and lost spacing between words.  I took out the second "$" and instead emphasized it with the word "dollars" which solved the immediate problem.  However, in the listing of the question, (not the question itself) the same thing happens after the first "$".  The summary shows the text without spaces between words and in italic.  Seems like a bug.  Below is a verbatim copy/paste of the original issue (two dollar signs):    I was able to find a small ESC for about $12 off of ebay.  If you were designing a robot, would you see that and think?       $12 bucks for an ESC that connects to simple pulse-wave interface -   sign me up!   Or would you think:     $12 just to control a motor? I could throw together an H-bridge for   $0.50 and be done with it.   My robot in particular actually has two motors and therefor $24 to control the two of them.  But the interface is really easy (plus has the added advantage of being R/C vs computer controlled with a simple change of connectors.  Which way would you go?
36608
I can get the element like this $("#txtEmail") but I'm not sure how to get the actual value.
68498
How can I validate some inputs that are not inside a form tag?  All the samples I found have a form tag, but I want to validate some inputs that are not inside a form.
55697
How do you set the cursor position in a text field using jQuery?  I've got a text field with content, and I want the users cursor to be positioned at a certain offset when they focus on the field.  The code should look kind of like this:  $('#input').focus(function() {   $(this).setCursorPosition(4); });   What would the implementation of that setCursorPosition function look like?  If you had a text field with the content abcdefg, this call would result in the cursor being positioned as follows: abcd**|**efg.  Java has a similar function, setCaretPosition.  Does a similar method exist for javascript?  Update: I modified CMS's code to work with jQuery as follows:  new function($) {   $.fn.setCursorPosition = function(pos) {     if (this.setSelectionRange) {       this.setSelectionRange(pos, pos);     } else if (this.createTextRange) {       var range = this.createTextRange();       range.collapse(true);       if(pos &lt; 0) {         pos = $(this).val().length + pos;       }       range.moveEnd('character', pos);       range.moveStart('character', pos);       range.select();     }   } }(jQuery);
55076
How do you convert a number to a string showing dollars and cents?  eg: 123.45    =&gt; '$123.45' 123.456   =&gt; '$123.46' 123       =&gt; '$123.00' .13       =&gt; '$0.13' .1        =&gt; '$0.10' 0         =&gt; '$0.00'
18919
I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount).  I run into this error. Anyone know what could be wrong or have any suggestions?   salesAmount = raw_input (["Insert sale amount here \n"]) ['Insert sale amount here \n']20.99 &gt;&gt;&gt; salesTax = 0.08 &gt;&gt;&gt; totalAmount = salesAmount * salesTax  Traceback (most recent call last):   File "&lt;pyshell#57&gt;", line 1, in &lt;module&gt;     totalAmount = salesAmount * salesTax TypeError: can't multiply sequence by non-int of type 'float'
10911
With jQuery, how do I find out which key was pressed when I bind to the keypress event?  $('#searchbox input').bind('keypress', function(e) {});   I want to trigger a submit when ENTER is pressed.  [Update]  Even though I found the (or better: one) answer myself, there seems to be some room for variation ;)  Is there a difference between keyCode and which - especially if I'm just looking for ENTER, which will never be a unicode key?  Do some browsers provide one property and others provide the other one?
37458
goal: write the most concise function that formats a (String) decimal into a currency format in Apex. Feel free to trainwreck the code for points, I've kept mine exploded for readability purposes.
8261
So apparently hiding content using "display: none" is bad for SEO and seen by googlebot as being deceptive. This according to a lot of the posts I read online and questions even on this site.  But what if I hide keyword rich text using javascript? A jquery example:  $(function() {    $('#keywordRichTextContainer').hide(); });   or using visibility hidden:  $(function() {    $('#keywordRichTextContainer').css({       visibility: 'hidden',       position: 'absolute'    }); });   Would any of these techniques cause my site to be penalized? If googlebot can't read javascript then if I'm hiding through js it shouldn't know right?  What about using "text-indent: -9999px"?