<Modal show={props.show} onHide={() => props.close()} size="lg" centered aria-labelledby="contained-modal-title-vcenter" >
<Modal.Header closeButton>
<Modal.Title>Modal heading</Modal.Title>
</Modal.Header>
<Modal.Body>
some random text................
You include the script with the following code:
<script src='script.js'></script>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={() => props.close()}>
Close
</Button>
<Button variant="primary">
Download
</Button>
</Modal.Footer>
</Modal>
In the above code I want the script tag line in Modal.Body
to be displayed as text but instead the code is being executed. I tried enclosing the script tag in span
but its still doesn't work, same is happening with <input>
and <canvas>
Replace the Less than sign ( <
) with <
and similarly replace the Greater than sign ( >
) with >
.
So your code will become:
<script src='script.js'></script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.