Code, give item is a valid ip (i.e. 254.253.242.222 )
`var h0 = Math.pow(256,0);`
`var h1 = Math.pow(256,1);`
`var h2 = Math.pow(256,2);`
var h3 = Math.pow(256,3);
var splitup = item.split('.'); var iHex = (splitup[3] * h0) + (splitup[2] * h1) + (splitup[1]* h2) + (splitup[0] * h3) ;
var hhexip = parseInt(iHex,16);
$('#hexip').val($('#hexip').val() + "0x" + hhexip +"\n" );
this site http://www.silisoftware.com/tools/ipconverter.php?convert_from=254.253.242.222
edit
fixed code to use math.pow... still getting wrong out put though. says it should be 0xFEFDF2DE
but i get 0x285481457222
help?