Fetch data in second textbox against matching column by typing in first textbox using PHP and Jquery

I have sample table:

From To Grade
0 49 F
50 69 D
70 79 C
80 89 B
90 100 A

I have two textboxes Marks and Grades. When I type 50 in first textbox then second textbox should be populated with “D” grade.
How to do it with PHP and jquery?