0

Imagine i have View and it contains :

  <ol >  
   <li> ....</li>         
</ol>

I want to know if its possible when i dynamically added another

  • element and append to this list and saving it in View(in an other saying to Project) permanently?Then it becomes like this when i open
       <ol >  
       <li> ....</li> 
       <li>New Added dynamically element by jquery </li>  
    </ol>
    

    Add element -> edit and save View ->When i open project again it comes with last changes that i made

  • obek
    • 1
    • 1
    • Possible duplicate of [How to add
    • in an existing
        ?](https://stackoverflow.com/questions/1145208/how-to-add-li-in-an-existing-ul)
    • – Wurd Sep 27 '18 at 19:54
  • Answer is No, you cant edit your html file with javascript. – Void Spirit Sep 27 '18 at 20:00
  • So how can i do this with other ways?Any recommendation to do this ? @TimaGegewepe – obek Sep 27 '18 at 20:17
  • @Wurd not the same problem – obek Sep 27 '18 at 20:20
  • @obek what you want to develop is incorrect or I don't get what is your idea. Because you have to make dynamic page, so you will be getting data from db, iterate and generate page with those data. Anyways, imagine you were able to accomplish what you wanted, adding new data to the html will increase the file size and loading time will be longer. – Void Spirit Sep 27 '18 at 20:24
  • I simply want to take text from text area when clicked to button and add it to list and save it to View.Suppose this list to "announcements list" of student page of school.Authorized person adding new announcement and save it then other students see new annoncement when they logged in.@TimaGegewepe sorry if i cant explain myself well – obek Sep 27 '18 at 20:31
  • 1
    You save it to a database, you don't save things like that to a view. The view is essentially a container for the information and how to render it. The controller will be used to get the data to/from a database and pass the data to the view for rendering. – Mark Fitzpatrick Sep 28 '18 at 02:53
  • @MarkFitzpatrick I mean how to save all of it(in my question its announcement) in database(example you mean in mssql or smthng ?) – obek Sep 29 '18 at 09:53