Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,10 +110,14 @@ footer {visibility: hidden !important;}
|
|
| 110 |
custom_javascript = """
|
| 111 |
document.addEventListener('DOMContentLoaded', function() {
|
| 112 |
const instructionElement = document.querySelector('textarea');
|
| 113 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
function updateCharCount() {
|
| 116 |
-
const text = instructionElement.value.replace(/\\s
|
| 117 |
const charCount = text.length;
|
| 118 |
charCounterElement.textContent = `${charCount}/250`;
|
| 119 |
}
|
|
|
|
| 110 |
custom_javascript = """
|
| 111 |
document.addEventListener('DOMContentLoaded', function() {
|
| 112 |
const instructionElement = document.querySelector('textarea');
|
| 113 |
+
const submitButton = document.querySelector('.submit-button-class');
|
| 114 |
+
const charCounterElement = document.createElement('span');
|
| 115 |
+
charCounterElement.classList.add('char-counter-class');
|
| 116 |
+
charCounterElement.textContent = '0/250';
|
| 117 |
+
submitButton.appendChild(charCounterElement);
|
| 118 |
|
| 119 |
function updateCharCount() {
|
| 120 |
+
const text = instructionElement.value.replace(/\\s/g, '');
|
| 121 |
const charCount = text.length;
|
| 122 |
charCounterElement.textContent = `${charCount}/250`;
|
| 123 |
}
|