My html and jquery code looks like below but for some reason I can change the text of the span. I m trying with both find and closest methods. Any ideas? thanks
<body>
<span class="classA">Text A</span>
<input id="testId" type="file" name="files" class="fileUp">
<span class="classA">Text B</span>
<script type="text/javascript">
$(document).ready(function () {
$("input.fileUp").change(function (event) {
$(this).closest('span.classA').text('testing');
$(this).find('span.classA').text('testing');
});
});
</script>
</body>