0

i'm going to send fileVO(java bean) to my js file. how to get this value from js?

model attribute from java.

   model.addAttribute("fileVO", fileVOListTmp.get(0));

and I need to get this value in javascript.

<script>
        var fileVO = $('#fileVO').val();
        alert(fileVO);

</script>

but it shows undefined

jojo kim
  • 141
  • 3
  • 7
  • 2
    Possible duplicate of [How to access model attribute in Javascript](https://stackoverflow.com/questions/9361977/how-to-access-model-attribute-in-javascript) – shukshin.ivan Aug 23 '17 at 00:52
  • what does the return output looks in DOM ? does the element has an Id of "fileVO" ? if not then it will never return the value that you are trying to get. – JF-Mechs Aug 23 '17 at 00:52

0 Answers0