alert('Stock purchased successfully!');
});
+ // Handle Sell Stock Form submission
+ document.getElementById('sellStockForm').addEventListener('submit', async (event) => {
+ event.preventDefault();
+ const stockName = event.target.stockName.value;
+ const quantity = event.target.quantity.value;
+ // Here you would typically check the user's balance for the stock and proceed with the sale
+ // Simulating a successful sale for demonstration purposes
+ alert(`Successfully sold ${quantity} shares of ${stockName}!`);
+ console.log(`Selling Stock: ${stockName}, Quantity: ${quantity}`);
+ });
+
+
// Button actions
document.getElementById('viewOwnershipBtn').addEventListener('click', () => {
alert('Feature not implemented yet!');