I need to get the value of the styleClass element in javascript. Page is in jsp with struts/html tag elements. jsp code is
<input type="hidden" class="filename" name="filename" value="<%= filename %>" />
<html:file property="testfile" styleClass="testfile"/>
and onclick of button I invoke the javascript
function fields() {
var filename = jQuery('.filename');
alert(filename);
var testfile= jQuery('.testfile').val();
alert(testfile);
}
However in the firstcase(filename) I get [object object] returned and in second case I get "undefined". Can someone give some pointers on how to get the uploaded file name in jquery. Thanks