How Can I Handle Multiple Offers When Selling My NJ Home?

// ---------- state tables ---------- const propTax={AL:.0041,AK:.0116,AZ:.0056,AR:.0059,CA:.0071,CO:.0049,CT:.0214,DE:.0055,DC:.0056,FL:.0082,GA:.0083,HI:.0027,ID:.0056,IL:.0211,IN:.0077,IA:.0149,KS:.0134,KY:.008,LA:.0055,ME:.0117,MD:.0102,MA:.0115,MI:.0135,MN:.0105,MS:.0076,MO:.0091,MT:.0079,NE:.0154,NV:.005,NH:.0189,NJ:.0233,NM:.0074,NY:.0164,NC:.0073,ND:.0099,OH:.0143,OK:.0085,OR:.0086,PA:.0141,RI:.0139,SC:.0053,SD:.0114,TN:.0058,TX:.0163,UT:.0055,VT:.0178,VA:.0076,WA:.0088,WV:.0055,WI:.0159,WY:.0058}; const stateInc={AL:.05,AK:0,AZ:.025,AR:.039,CA:.133,CO:.044,CT:.0699,DE:.066,DC:.1075,FL:0,GA:.0539,HI:.11,ID:.05695,IL:.0495,IN:.03,IA:.038,KS:.0558,KY:.04,LA:.03,ME:.0715,MD:.0575,MA:.09,MI:.0425,MN:.0985,MS:.044,MO:.047,MT:.059,NE:.052,NV:0,NH:0,NJ:.1075,NM:.059,NY:.109,NC:.0425,ND:.025,OH:.035,OK:.0475,OR:.099,PA:.0307,RI:.0599,SC:.062,SD:0,TN:0,TX:0,UT:.0455,VT:.0875,VA:.0575,WA:0,WV:.0482,WI:.0765,WY:0}; const insure={AL:2989,AK:933,AZ:2245,AR:3151,CA:1429,CO:3167,CT:1660,DE:964,DC:1513,FL:5488,GA:1994,HI:1224,ID:1293,IL:2265,IN:1712,IA:2197,KS:4287,KY:3354,LA:4135,ME:1243,MD:1671,MA:1703,MI:2117,MN:2628,MS:3339,MO:2302,MT:2511,NE:5640,NV:1031,NH:1026,NJ:1194,NM:2205,NY:1752,NC:2055,ND:2709,OH:1303,OK:4643,OR:1011,PA:1245,RI:2324,SC:2374,SD:3049,TN:2499,TX:3973,UT:1262,VT:830,VA:1664,WA:1513,WV:1009,WI:1219,WY:1306}; // ---------- federal tax helpers ---------- const FED_STD=15750; const FED_BRACK=[[11925,.10],[48475,.12],[103350,.22],[197300,.24],[250525,.32],[626350,.35],[Infinity,.37]]; const fmt=n=>n.toLocaleString('en-US',{style:'currency',currency:'USD'}); function fedTax(income){ let t=0,x=Math.max(0,income-FED_STD),lo=0; for(const[hi,r] of FED_BRACK){ if(x<=0)break; const span=Math.min(x,hi-lo); t+=span*r; x-=span; lo=hi; } return t; } function stTax(income,st){ return Math.max(0,income-FED_STD)*(stateInc[st]||0); } function mortgage(val,r=0.0674,d=.2,y=30){ const P=val*(1-d),m=r/12,n=y*12; return m===0?P/n:(P*m)/(1-(1+m)**-n); } // ---------- input helpers ---------- document.addEventListener('DOMContentLoaded', function(){ ['haa-income','haa-price'].forEach(id=>{ const el=document.getElementById(id); if(el){ el.addEventListener('blur',()=>{ const v=parseFloat(el.value.replace(/[^0-9.]/g,'')); if(v>0)el.value=fmt(v); }); } }); }); function showErr(id,msg){ const e=document.getElementById(id); if(e){ e.textContent=msg; e.style.display='block'; } } function clearErrs(){ ['err-address','err-income'].forEach(i=>{ const el=document.getElementById(i); if(el)el.style.display='none'; }); } // ---------- main ---------- function haaEvaluate(){ clearErrs(); const addr=document.getElementById('haa-address').value.trim(); const incRaw=document.getElementById('haa-income').value.replace(/[^0-9.]/g,''); const priceRaw=document.getElementById('haa-price').value.replace(/[^0-9.]/g,''); const out=document.getElementById('haa-output'); out.innerHTML=''; out.className=''; let valid=true; const stMatch=addr.match(/\b[A-Z]{2}\b/); const zipMatch=addr.match(/\b\d{5}\b/); if(!addr||(!stMatch&&!zipMatch)){ showErr('err-address','Please include state or ZIP.'); valid=false; } const income=parseFloat(incRaw); if(!income||income<=0){ showErr('err-income','Enter a positive income.'); valid=false; } if(!valid)return; const st=stMatch?stMatch[0].toUpperCase():''; const homeVal=priceRaw?parseFloat(priceRaw):Math.min(income*4,1_000_000); const mMort=mortgage(homeVal); const annTax=homeVal*(propTax[st]??0.01); const annIns=insure[st]??2258; const net=income - fedTax(income) - stTax(income,st); const netMo=net/12; const cost=mMort+annTax/12+annIns/12; const thresh=netMo*0.30; const ok=cost<=thresh; out.className='haa-result '+(ok?'positive':'negative'); out.innerHTML='

'+ (ok?'Yes\u00a0–\u00a0affordable':'No\u00a0–\u00a0not affordable') + '

' + '

Total monthly cost: '+ fmt(cost) +'
' + '\u2022\u00a0Mortgage\u00a0P&I\u202f'+ fmt(mMort) +'
' + '\u2022\u00a0Property\u202ftax\u202f'+ fmt(annTax/12) +'
' + '\u2022\u00a0Insurance\u202f'+ fmt(annIns/12) +'

' + '

Net monthly income: '+ fmt(netMo) +'
' + '30\u202f% of net\u202fincome\u00a0=\u00a0'+ fmt(thresh) +'

'; out.scrollIntoView({behavior:'smooth',block:'start'}); }