> For the complete documentation index, see [llms.txt](https://docs.allthingsghl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allthingsghl.com/funnels/texts/typerwriter-effect-1.md).

# Typewriter Effect

<figure><img src="/files/0iBoSsL4sqYUwQhrs7PD" alt=""><figcaption></figcaption></figure>

```html
<style>
#heading-JkcgZmWRdVW h1 u { text-decoration: none !important; }
</style>

<script>

elementType = "h1 strong u";
phrases = "Highlevel|Code Resources|Highlevel Marketplace Partners|Highlevel News";

typeSpeed         = 50;
unTypeSpeed       = 30;
startWait         = 2000;
phraseDisplayWait = 2000;
typingWait        = 700;

/* do not edit! */
dynoType = null;
currentText = '';
whichPhrase = 0;
phrasesArray = phrases.split('|');
classArray = elementType.split(',');

/* start! */
for(var i = 0; i < classArray.length; i++){
	classArray[i] = '.dynamic-text ' + classArray[i];
}
wait4TypeEl = setInterval(function(){
	typeEl = document.querySelector(classArray[0]);
	if(typeEl){
		clearInterval(wait4TypeEl);
		setTimeout(function(){
		
		},startWait/2);
		setTimeout(unTypePhrase,startWait);
	}
});
function typePhrase(){
	currentPhrase = phrasesArray[whichPhrase];
	for(var i = 0; i < classArray.length; i++){
		document.querySelector(classArray[i]).innerHTML = '';
	}
	typing = setInterval(function(){
		if(currentPhrase.length){
			snippet = currentPhrase.slice(0,1);
			currentPhrase = currentPhrase.substring(1);
			for(var i = 0; i < classArray.length; i++){
				document.querySelector(classArray[i]).innerHTML += snippet;
			}
		} else {
			clearInterval(typing);
			setTimeout(unTypePhrase,phraseDisplayWait);
		}
	},typeSpeed);
}
function unTypePhrase(){
	currentPhrase = document.querySelector(classArray[0]).innerHTML;
	typing = setInterval(function(){
		if(currentPhrase.length){
			currentPhrase = currentPhrase.substring(0,currentPhrase.length-1);
			for(var i = 0; i < classArray.length; i++){
				document.querySelector(classArray[i]).innerHTML = currentPhrase;
			}
		} else {
			clearInterval(typing);
			for(var i = 0; i < classArray.length; i++){
				document.querySelector(classArray[i]).innerHTML = '';
			}
			whichPhrase++;
			whichPhrase = (whichPhrase >= phrasesArray.length)? 0 : whichPhrase;
			setTimeout(typePhrase,typingWait);
		}
	},unTypeSpeed);
}
</script>
```

### Create Headline

1. Create Headline element on Funnel
2. Enter any text to your Headline element
3. **Bold** the text you want to have the typewriter effect on. &#x20;

### Add Code

1. Create a `Custom JavaScript/CSS` element on the funnel page under the Headline
2. Paste code into the block

### Update Code

1. Update Phrases Section:  \
   "phrases = `Highlevel|Code Resources|Highlevel Marketplace Partners|Highlevel News`
2. Update Heading CSS Selector
   1. Click on `Headline`
   2. Go to `Advanced`
   3. Scroll down and copy the text in "CSS Selector"&#x20;
      1. Example:  `#heading-JkcgZmWRdVW`
   4. Replace text on line 2 of code

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.allthingsghl.com/funnels/texts/typerwriter-effect-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
