> One good way to write your function would be:
>
>  function gotoNextPageMikesWay()
>  {
>    var start = $("start");
>    start.value = +start.value + ( +$("rows").value );
>  }
>
> The unary + converts each value to a number. You'll see this fairly often;

Hi Michael,

The issue is solved and understood know. There is no JS Bug.

But I want to comment that I find the above interesting because I know
I did try using the unary + and it didn't work.
Sure, it will work fine is of the left side is numeric.  But that is
not what we have here.   This issue was the inclusive addition
assignment operator, like so:

  $('start').value  += +$('rows').value;

still concatenated strings, and going down to the simpliest, no DOM
method used, does as well

    v1 = "100";  v2 = "20";
    v1 += +v2;

v1 is not "10020"

So the unary + is not really going to help unless the left side is
number.

Anyway,  its a done deal. Thanks for your comment. :-)

--
HLS

Reply via email to