Hi Thomas,
you can use like this..
var $parentDiv = $('.mytextbox').closest('.mytextbox');
$parentDiv.find('input').val('value'); //finding the inputs inside the class
$parentDiv.find('textarea').val('value'); //finding the textarea inside the class
At what point are you executing the code? If it's on pageload (instead of a button f.i.), then the elements are probably not loaded yet when the script is executed, and the code won't retrieve the element. If so, you can fix this by adding a small delay.
See an example below
setTimeout(() => { console.log("World!"); }, 2000);