// เมื่อกดปุ่มทำนาย $w.onReady(function () { $w('#predictButton').onClick(() => { let phone = $w('#phoneInput').value; // ดึงค่าจากฟอร์ม if(!phone || phone.length < 10){ $w('#resultText').text = "กรุณากรอกเบอร์มือถือให้ครบ"; return; } // ฟังก์ชันทำนายดวง let prediction = predictNumber(phone); $w('#resultText').text = prediction; }); }); // ฟังก์ชันทำนายเลขมือถือ function predictNumber(number){ let sum = number.split('').reduce((a,b)=> a + parseInt(b), 0); if(sum % 2 === 0) return "การเงินดี ความรักปานกลาง การงานรุ่ง"; else return "การเงินปานกลาง ความรักโดดเด่น การงานดี"; }
top of page

Create Your First Project

Start adding your projects to your portfolio. Click on "Manage Projects" to get started

Project Title

Project Type

Photography

Date

April 2023

This is where the project description goes. Give an overview or go in depth - what it's all about, what inspired you, how you created it, or anything else you'd like visitors to know. To add Project descriptions, go to Manage Projects.

bottom of page