Question: I'm having trouble creating a jQuery Accordion using javascript. It creates the Accodion labels just fine, and shows the text of the first element too. It does not show the second elements text, and when you click on it, you lose the first oned text forever too.

```
$("#tab-dock").append('<div id="daccordion">')

$("#daccordion").append('<div id="dinfo"><h3><a href="#">Info</a></h3>')
$("#dinfo").append('<div>Some info about this location.</div>')
$("#daccordion").append('</div>')

$("#daccordion").append('<div id="dmarket"><h3><a href="#">Market</a></h3>')
$("#dmarket").append('<div>Market info would go here!</div>')
$("#daccordion").append('</div>')

$("#tab-dock").append('</div>')

$("#daccordion").accordion({ header: "h3",navigation: true });

```

I have another Accodion which was created normally and it works fine. I just can't get them to match up though. Any ideas? Thanks!

Edit: Thanks for all of the suggestions, learned quite a bit just from them. The problem turned out to be due to size, I had to call the Accordion's resize to get it working.

Answer: 
Seems like your examples formatted with three digits groups except last, you can write a simple function, uses thousand seperator and adds last digit:

```
>>> def phone_format(n):                                                                                                                                  
...     return format(int(n[:-1]), ",").replace(",", "-") + n[-1]                                                                                                           
... 
>>> phone_format("5555555")
'555-5555'
>>> phone_format("5555555")
'555-5555'
>>> phone_format("5555555555")
'555-555-5555'
>>> phone_format("18005555555")
'1-800-555-5555'

```
In my case, I needed to get a phone pattern like "\*\*\* \*\*\* \*\*\*" by country.

So I re-used `phonenumbers` package in our project

```py
from phonenumbers import country_code_for_region, format_number, PhoneMetadata, PhoneNumberFormat, parse as parse_phone
import re

def get_country_phone_pattern(country_code: str):
    mobile_number_example = PhoneMetadata.metadata_for_region(country_code).mobile.example_number
    formatted_phone = format_number(parse_phone(mobile_number_example, country_code), PhoneNumberFormat.INTERNATIONAL)
    without_country_code = " ".join(formatted_phone.split()[1:])
    return re.sub("\d", "*", without_country_code)

get_country_phone_pattern("KG")  # *** *** ***

```