how to do a conditional between range javascript code example Example: If statement that tests if a value is in range if ((x >= xmin) && (x <= xmax)) { // something }