Emotions, including stress and anxiety, strongly influence cognition and learning experiences. This study investigates the impacts of stress on cognitive load during learning, considering baseline anxiety levels and fluctuating stress. With a focus on technology-based learning, a web-based HTML introduction module was used. Using a social stress test, 15 participants underwent a stressful situation during learning, while the control group of 15 were in a neutral condition. Results indicate significantly elevated stress levels in the experimental group throughout the experiment, with a corresponding decrease in learning performance. For high perceived difficulty, the stressed condition demonstrated a significant increase in response time compared to the control condition. In contrast, when experiencing low perceived difficulty, a significant difference in response time across conditions was not found. Findings emphasise the importance of managing stress in educational contexts to optimise learning outcomes in the evolving landscape of technology-based learning.