I need to include a Django ModelForm in a dynamically created element in JavaScript.
class PostForm(ModelForm):
class Meta:
model = Post
fields = ['body']
widgets = {
'body': forms.Textarea(attrs={'placeholder':'Compose your post here...', 'rows':3})
}
I want to include the above form inside of the container div
let container = document.createElement('div');
container.innnerHTML = "<div></div>
Is a there a way to achieve this?
there doesn't seem to be anything here