JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="width" value="" id="width" />
<input type="text" name="height" value="" id="height" />
<br />
<br />
<img src="http://static.elderscrollsonline.com/assets/img/cms/media/blogs/ae63764bd2490144473b4d1d251cb078.jpg" id="img" />

JavaScript

$(function() {
    $('#width, #height').keyup(function() {
    var width = $('#width').val() + 'px';
    var height = $('#height').val() + 'px';
    
    $('#img').css({
        "width" : width,
        "height": height
    }); 
    });
});