Let’s say I have an image and a textfield. Whenever I type a specific word into the textfield… I want the image to dynamically and ajax-acally change (without reloading the web page) to the image I set it at…
How is this done? Maybe using PHP/jQuery?
This has nothing to do with a server-side language like PHP.
Using jQuery:
Alternatively, you could maintain a hash of text => image-src pairs. Instead of a switch statement, you could simply see if the text the user has entered exists has a matching image src within the hash.